You can probably install a signal handler (using [tt]signal[/tt]) that gets called when the Task Manager sends your program a signal. I don't know which signal you need to catch, though.
You can also install an exit handler (using [tt]atexit[/tt]). That sets up a function to get called when the program is about to exit (except in the event of a crash).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.