Detect what sent WM_QUERYENDSESSION?
I know after reading about WM_QUERYENDSESSION that windows typically sends this message to all running applications when a user is either logging off, restarting, or shutting a PC down. I have an application with a handler for when this event is received, so I can see that the WM_QUERYENDSESSION message is coming in, but I don't know what is causing it. The user claims that the application "stops working" suddenly and freezes up, and I assume that they weren't logging off or restarting or shutting down the PC. Is there any other instance in which the WM_QUERYENDSESSION could be sent out to applications or is there a something I can look for in determining what caused it?
Re: Detect what sent WM_QUERYENDSESSION?
WM_QUERYENDSESSION is also sent when the ExitWindows() function is called.
lParam contains some simple info re the reason for WM_QUERYENDSESSION called.
Re: Detect what sent WM_QUERYENDSESSION?
Quote:
Originally Posted by
Ciralia
... is there a something I can look for in determining what caused it?
Well, 2kaud has already answered you.
But I wonder why do you ignore MSDN?
Just read about WM_QUERYENDSESSION message and all the related topics from the section See also!