[DUG] WM_QueryEndSession

Rohit Gupta rohit at cfl.co.nz
Wed Jul 13 12:50:58 NZST 2005


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" <trevorj at ihug.co.nz>
To:             	<rohit at cfl.co.nz>,
  	"'NZ Borland Developers Group - Delphi List'" <delphi at ns3.123.co.nz>
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 <delphi at ns3.123.co.nz>
	<mailto:delphi-request at ns3.123.co.nz?subject=unsubscribe>
	<mailto:delphi-request at ns3.123.co.nz?subject=subscribe>

[ 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: 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 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 rohit at cfl.co.nz  or  r.gupta at xtra.co.nz
====================================================
==================


_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
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 rohit at cfl.co.nz  or  r.gupta at xtra.co.nz
======================================================================




More information about the Delphi mailing list