W William Stacey [MVP] Mar 31, 2006 #1 How can you signal Ctrl-C to a managed process (i.e. process is hosting cmd.exe)? TIA
M Mattias Sjögren Mar 31, 2006 #2 How can you signal Ctrl-C to a managed process (i.e. process is hosting cmd.exe)? Click to expand... If I understand the question correctly, you can call GenerateConsoleCtrlEvent(CTRL_C_EVENT). It should work for any console process, managed or not. http://msdn.microsoft.com/library/en-us/dllproc/base/generateconsolectrlevent.asp Mattias
How can you signal Ctrl-C to a managed process (i.e. process is hosting cmd.exe)? Click to expand... If I understand the question correctly, you can call GenerateConsoleCtrlEvent(CTRL_C_EVENT). It should work for any console process, managed or not. http://msdn.microsoft.com/library/en-us/dllproc/base/generateconsolectrlevent.asp Mattias
W William Stacey [MVP] Mar 31, 2006 #3 Thanks Mattias. Know how to get the "dwProcessGroupId ", when all I have is the Process.Id ? TIA -- William Stacey [MVP] | | >How can you signal Ctrl-C to a managed process (i.e. process is hosting | >cmd.exe)? | | If I understand the question correctly, you can call | GenerateConsoleCtrlEvent(CTRL_C_EVENT). It should work for any console | process, managed or not. | | http://msdn.microsoft.com/library/en-us/dllproc/base/generateconsolectrlevent.asp | | | Mattias | | -- | Mattias Sjögren [C# MVP] mattias @ mvps.org | http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com | Please reply only to the newsgroup.
Thanks Mattias. Know how to get the "dwProcessGroupId ", when all I have is the Process.Id ? TIA -- William Stacey [MVP] | | >How can you signal Ctrl-C to a managed process (i.e. process is hosting | >cmd.exe)? | | If I understand the question correctly, you can call | GenerateConsoleCtrlEvent(CTRL_C_EVENT). It should work for any console | process, managed or not. | | http://msdn.microsoft.com/library/en-us/dllproc/base/generateconsolectrlevent.asp | | | Mattias | | -- | Mattias Sjögren [C# MVP] mattias @ mvps.org | http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com | Please reply only to the newsgroup.