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;
From: "Trevor Jones" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>,
"'NZ Borland Developers Group - Delphi List'" <[email protected]>
Subject: RE: [DUG] WM_QueryEndSession
Date sent: Wed, 13 Jul 2005 10:02:16 +1200
Copies to:
Send reply to: NZ Borland Developers Group - Delphi List
<[email protected]>
<mailto:[EMAIL PROTECTED]>
<mailto:[EMAIL PROTECTED]>
[ Double-click this line for list subscription options ]
I have it working in a number of apps.
Remember that WM_QueryEndSession is just that: a query, and it allows your
app to say no. Is your app settings Msg.result to 1 in your handler? If
not, then maybe your own app is saying no.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Rohit Gupta
Sent: Wednesday, 13 July 2005 9:39 a.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] WM_QueryEndSession
Has anyone had this working. I have tried it on and off for months
and I am not convinced that it works.
The idea was to shut down the unattended applications on receiving
this so that the Firebird Service can shut down afterwards without
prompting the user.
I can hook this message into an event on the mainform. However,
niether Form.Close nor Application.Terminate appear to do
anything.
Regards
Rohit
====================================================
==================
CFL - Computer Fanatics Ltd. 21 Barry's Point Road, AKL, New
Zealand
PH (649) 489-2280
FX (649) 489-2290
email [EMAIL PROTECTED] or [EMAIL PROTECTED]
====================================================
==================
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi
Regards
Rohit
======================================================================
CFL - Computer Fanatics Ltd. 21 Barry's Point Road, AKL, New Zealand
PH (649) 489-2280
FX (649) 489-2290
email [EMAIL PROTECTED] or [EMAIL PROTECTED]
======================================================================
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi