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?

有帮助吗?

解决方案

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).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top