How can you signal Ctrl-C to a managed process (i.e. process is hosting
cmd.exe)? TIA
>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

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
William Stacey [MVP] - 31 Mar 2006 22:32 GMT
Thanks Mattias. Know how to get the "dwProcessGroupId ", when all I have is
the Process.Id ? TIA

Signature
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