I have a Windows C ++ application (app.exe). When the application is closed, I need to perform some cleaning tasks specific to my application. What happens when this process (app.exe) is killed through the Task Manager. Assuming the application is still responding, can I somehow handle this situation in my app.exe?
I am looking for something similar to how kill <pid> on Linux will send a SIGTERM signal to the process indicated by pid. Then I could register my own signal handler for SIGTERM and do the cleanup.
source share