[DUG] WM_QueryEndSession

Trevor Jones trevorj at ihug.co.nz
Wed Jul 13 13:02:51 NZST 2005


Rohit,
  Are you sure that you weren't fighting Rohit?

  If you handle the WM_QUERYENDSESSION in your main form instead of in the
TApplication, you'll need to check that none of your other forms are modal
(and if so, cancel them), then just call close.  


-----Original Message-----
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz] On
Behalf Of Rohit Gupta
Sent: Wednesday, 13 July 2005 12:51 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: RE: [DUG] WM_QueryEndSession

Finally got it working.  A pig of a thing.  First fight windows then fight 
Borland.

As mentioned, Close and Terminate were not working.  I am now 
using Halt... this at least executes all finalization sections.

For others, the sequence is

{ Tell Windows to go ahead }
Msg.Result  := 1;
{ Tidyup what would have been in FormClose }
FormCloseCode;
{ Call inherited because of Halt, otherwise Msg.Result is random }
inherited;
{ Shut Down App right away }
Halt;



More information about the Delphi mailing list