There is an application that runs all the time and sits in the tray. When the user logs out (shutdown, restart and just exit), you need to save the state of the application to the registry. How does this moment (before the exit) catch?
1 answer
WM_QUERYENDSESSION message is sent to each application before windows exit.
function GetMessage(var Msg: TMsg; Wnd: HWnd; MsgFilterMin, MsgFilterMax: Word): Bool;
Reads a message, in the frames of the filtering range, from the queue of the application task messages. Leaves the control to other tasks, if there are no messages or if the next message is wm_Paint or wm_Timer.
|