From: "Ara.T.Howard" Date: 2005-09-23T14:11:40+09:00 Subject: Re: Trapping TaskManager's kill process on win32 On Fri, 23 Sep 2005, Daniel Berger wrote: > gga wrote: >> Is there a way to trap the killing of a ruby windows process killed >> thru the TaskManager? >> I've tried trap(INT), trap(ABRT) and trap(KILL) and none seem to >> respond to kill process. > > 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? under *nix you can trap almost all signals - but not this one for that very reason. that's why 'kill -9' is dang handy ;-) -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | Your life dwells amoung the causes of death | Like a lamp standing in a strong breeze. --Nagarjuna ===============================================================================