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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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;

_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to