I'm working on windows 8 metro style app. I want to show a save confirmation message whenever unexpected events occur such as shutdown or restart and prevent windows to do that event. However, I didn't find any handler event that fitting my need. How can I do that?
Asked
Active
Viewed 424 times
1 Answers
0
In general, a Windows app can prevent shutdown (sometimes) by responding with FALSE to a WM_QUERYENDSESSION message. However, there is no way to get a WindowProc message from a Metro style app. The best you can do in a Metro style app is handle the Suspending event properly in your app (this will not prevent a shutdown of course).

JP Alioto
- 44,864
- 6
- 88
- 112
-
It should be noted that you need to handle the save state better anyway -- you can be terminated any time you are switched away, not just on shutdown. – Dominic Hopton Jul 31 '12 at 14:16