This message is sent when the user chooses the End Session command. If any application returns zero, the session is not ended. Windows stops sending WM_QUERYENDSESSION messages as soon as one application returns zero, and sends WM_ENDSESSION messages, with the wParam parameter set to zero, to any applications that have already returned nonzero.
wParam
This parameter is not used.
lParam
This parameter is not used.
The return value is nonzero if the application can be conveniently shut down. Otherwise, it is zero.
The DefWindowProc function returns nonzero.