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
SendMessage can be used to send window messages with any parameters to a window.
Very useful for debugging and testing.
Send the message WM_QUERYENDSESSION
with LPARAM
= ENDSESSION_CLOSEAPP
.
The application must return 1 (TRUE) to indicate it's prepared to shut down and restart.
Send the message WM_ENDSESSION
with LPARAM = ENDSESSION_CLOSEAPP
The application must shut down within the specified timeout period.