How to simulate Windows shutdown for debugging?

后端 未结 4 1953
北恋
北恋 2020-12-04 16:54

I have an issue with my application when Windows shuts down - my app isn\'t exiting nicely, resulting in the End Task window being displayed. How can I use the debugger to s

4条回答
  •  伪装坚强ぢ
    2020-12-04 17:14

    I believe when Windows is shutting down it sends a "WM_QueryEndSession" to all applications. To simulate a Windows shutdown you could create a little application that just does a PostMessage with this message to your application and see what happens. Windows may send more messages than that to actually close your application (like WM_CLOSE), but whenever your application receives the "WM_QueryEndSession" message it means your application is about to have the rug pulled out from under it.

提交回复
热议问题