Resource Clean-up if process killed

G

Guest

Is it possible to listen for a kill message (that is, the process is
terminated) in a managed application.

The scenario is that if the process is killed, I'd like to clean up files
that were written to the user's temp directory.

Cheers
 
M

Mattias Sjögren

Is it possible to listen for a kill message (that is, the process is
terminated) in a managed application.

Do you mean from within the process itself or from a separate process?
There's no "kill message" AFAIK, and when you "kill" a process it gets
no chance to execute cleanup code. That's why using a more graceful
way of terminating an application is preferred.


Mattias
 
G

Guest

From a seperate process, ie. can I catch the user killing the process via the
task manager?

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top