[Win32utils-devel] Interesting use of Process.kill in win32-process
Daniel Berger
djberg96 at gmail.com
Wed Oct 19 10:31:22 EDT 2011
Hi all,
I stumbled onto this article today:
http://blog.robseaman.com/2008/12/12/sending-ctrl-c-to-a-subprocess-with-ruby
It's actually a few years old but I hadn't seen it before. He's using
an undocumented feature where passing nil as the pid has the effect of
passing a null to the dwProcessGroupId argument of the
GenerateConsoleCtrlEvent function. If this parameter is zero, the
signal is generated in all processes that share the console of the
calling process.
Anyway, I thought it was interesting. I'm wondering if I should
document that as "official" behavior, mainly to prevent us from
accidentally breaking it if people are relying on it.
Regards,
Dan
More information about the win32utils-devel
mailing list