Jump to content
Ian Branch

Detect Windows shutdown?

Recommended Posts

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 by mahris

Share this post


Link to post

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×