How do I handle the kill signal?

  • Thread starter Thread starter Haim
  • Start date Start date
H

Haim

Hi,
I would like to know if there is a way in the .NET to
handle the kill signal if sent to my process.
I want my application to close properly even if the user
is using the task manager to kill the process.
Does anybody know how to do this?

Thanks,

Haim.
 
I dont think you can. The Task manager kill is essentially a
"TerminateProcess". I dont think there is a way to hook into that. (I could
be wrong).
 
Haim said:
Hi,
I would like to know if there is a way in the .NET to
handle the kill signal if sent to my process.
I want my application to close properly even if the user
is using the task manager to kill the process.
Does anybody know how to do this?

You can't do this inside or outside of .NET (short of hacking Windows).

Nor as a user would I want you to. If all else fails I want to be able to
terminate instead rebooting like we had to in the bad old days.
 
Haim said:
Hi,
I would like to know if there is a way in the .NET to
handle the kill signal if sent to my process.
I want my application to close properly even if the user
is using the task manager to kill the process.
Does anybody know how to do this?

Windows isn't Unix. There aren't any signals, per se, and certainly no kill
signal.

John Saunders
 
Girish,

You are right, the process is not notified that it is terminating, nor can
it prevent itself from being terminated.

Willy.
 
Back
Top