Jump to content
  • Advertisement
Sign in to follow this  
vladic2000x

How to handle application termination via Task Manager(win32)

This topic is 3560 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Quote:
Original post by vladic2000x
There is a solution for .NET:
http://www.codeproject.com/KB/tips/CloseCheck.aspx

Still can't find an appropriate solutio for win32
If 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.

If there was a way to handle it, it'd be possible to make a process that can't be killed.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!