How to die gracefully

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If a Windows User decides to kill a process or a separate Windows app calls Process.Kill(), is there any way that the process being killed can see what's going on before it dies? I have a Windows Service that uses some third party dlls which are a bit messy. If the application is improperly closed, all kinds of things start to go wrong, so I want to catch the Kill command and clean up before dying

JER
 
Users should generally accept that if they kill a process, they do so at
their own risk. You can only tell them not to.

Jerry said:
If a Windows User decides to kill a process or a separate Windows app
calls Process.Kill(), is there any way that the process being killed can see
what's going on before it dies? I have a Windows Service that uses some
third party dlls which are a bit messy. If the application is improperly
closed, all kinds of things start to go wrong, so I want to catch the Kill
command and clean up before dying.
 
Windows services should not be killed, they should be stopped, and clean-up
should be done in the OnStop handler.

Willy.
 
Back
Top