How to handle application termination via Task Manager(win32)
Hey guys,
I need a way to save the player profile on game exit(win32,c++). In some cases like killing the process from task manager I don't see any destroy messages sent to windows procedure function (looked with spy++). Is there a simple way to know when the game is being killed like with the task manager example?
Thanks
When the taskmanager kills an application it calls TerminateProcess. The application must be killed without an option to catch this try. So in my opinion it is not possible to react for the application.
And that is definitly a good thing. If you have a buggy TerminateProcess-Handler you have to reboot the whole PC to kill the application. And that is just a friendly scenario :-).
With best regards,
Kimmi
And that is definitly a good thing. If you have a buggy TerminateProcess-Handler you have to reboot the whole PC to kill the application. And that is just a friendly scenario :-).
With best regards,
Kimmi
Those messages are only sent when you kill the application with Alt+F4 (or with another normal way to end an application).
There is a solution for .NET:
http://www.codeproject.com/KB/tips/CloseCheck.aspx
Still can't find an appropriate solutio for win32
http://www.codeproject.com/KB/tips/CloseCheck.aspx
Still can't find an appropriate solutio for win32
Quote:Original post by vladic2000xIf you close the window from Taskmanager, then you get the WM_CLOSE notification. If you end the process from task manager, then there's no way to handle it, in .NET or Win32.
There is a solution for .NET:
http://www.codeproject.com/KB/tips/CloseCheck.aspx
Still can't find an appropriate solutio for win32
If there was a way to handle it, it'd be possible to make a process that can't be killed.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement