I have this MFC program that when I kill it using the task manager, I get an exception in my program and then it crashes.
I want to get an event from the task manager when it is about to kill my process and gracefully close my program.
I understand that there are several methods that the task manager uses to kill the process.
1) On the Applications tab, someone told me that he is sending a WM_CLOSE message to the main visible window of my application. And if my application does not work after a few seconds, the task manager will detect it as not responding and use TerminateProcess () about its process.
2) On the process tab, someone told me that he is using the TerminateProcess () window API.
Is there any other method that uses task manager?
How can I say about the last two methods?
Thanks in advance.
eladyanai
source share