On 9/23/05, Daniel Berger <djberg96 / gmail.com> wrote:
> You can't.  Using the "end process" button on the Task Manager calls
> the TerminateProcess() function, which can't be trapped.  Read here for
> more:
>
> http://blogs.msdn.com/oldnewthing/archive/2004/07/22/191123.aspx
>
> It's probably a good thing, too.  Imagine if you did this:
>
> trap("KILL"){ # Do nothing }
>
> How would you kill the process short of rebooting?

Gee, so there's only a SIGKILL on Windows, and no equivalent of a
SIGTERM? What if I want the process to try to do some cleanup before
dying? This is something I do fairly often with my programs on
GNU/Linux. Now if the cleanup is hosed, obviously I'd expect a kill -9
to still work of course...