WM_QUERYENDSESSION
-
From Ole Server Application do we have to call this (WM_QUERYENDSESSION)
-
From Ole Server Application do we have to call this (WM_QUERYENDSESSION)
Member 2883067 wrote:
From Ole Server Application do we have to call this (WM_QUERYENDSESSION)
What you precisely mean with this sentence? The
WM_QUERYENDSESSION
message is sent by Windows in the initial steps of a shutdown. If you want to shutdown the operating system (turn-off, reboot, ...) you should use the ExitWindowsEx Function (Windows)[^], that logs off the interactive user, shuts down the system, or shuts down and restarts the system. It sends theWM_QUERYENDSESSION
message to all applications to determine if they can be terminated. For an example on how to use that API, see How to Shut Down the System (Windows)[^]