Daniel Berger
2011-Oct-19 14:31 UTC
[Win32utils-devel] Interesting use of Process.kill in win32-process
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