mahris 0 Posted May 30, 2022 (edited) No need to trigger WM_QUERYENDSESSION yourself, Delphi already does it in Forms.pas: procedure TCustomForm.WMQueryEndSession(var Message: TWMQueryEndSession); begin Message.Result := Integer(CloseQuery); end; So, do your actions in standard OnCloseQuery. Note. In my Windows 10, on shutdown I receive OnCloseQuery. but not OnClose (WM_CLOSE). Edited May 30, 2022 by mahris Share this post Link to post
Ian Branch 127 Posted May 30, 2022 Hi Mahris, Yes, since I started this I discovered and no use OnCloseQuery. Thank you for the follow up. Ian Share this post Link to post