Yes, this is what I am doing, but not the return true bit. I will check 
that bit out.

Thanks

-----Original Message-----
From: "Trevor Jones" <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Date: Wed, 12 Nov 2003 10:19:48 +1300
Subject: Re: [DUG]:  application shutdown

> MessageYou need to create a message handler for WM_QUERYENDSESSION and
> return true (I think - check the docs).
> 
> You can then also write a message handler for WM_ENDSESSION which you
> will get if no other program has vetoed the QUERYENDSESSION if you want
> to destroy objects etc when the Windows is actually shutting down.
>   ----- Original Message ----- 
>   From: Jeremy Coulter 
>   To: Multiple recipients of list delphi 
>   Sent: Wednesday, November 12, 2003 8:34 AM
>   Subject: [DUG]: application shutdown
> 
> 
>   Hi All. Following on from a question I asked yeterday where I said
> that when windows was shuttingdown or restarting, it would not close my
> application down.
>   My problem is slightly different to Al's problem in that when windows
> trys to shut my app, only the OnCloseQuery is fired EVEN if I set
> CanClose:=true;
> 
>   I decided to write my own handler for this message, and yes, now my
> application closed down, BUT then windows does not continue to
> close...weired.
> 
>   All my application needs to do is free a couple of stringlists, and
> close some DB tables.
>   IF I select my "exit" menu item which inturn calls the close event,
> it closes perfectly fine.
> 
>   I just cant work out WHY, windows wont close it down. I its prob.
> somehting I am doing, but blowed if I know !
>   Like I say, if I handle the windows message myself, it will close it
> fine...because I force it to call the close event, but then windows
> wont continue closing. I have sorted it for now by telling windows to
> reboot in me code, but......
> 
>   Any thoughts?
> 
>   Cheers,
> 
>   Jeremy Coulter
> 
> 
>  
> -----------------------------------------------------------------------
> -
>   All email scanned with Nortons Antivirus 2003
>  
> -----------------------------------------------------------------------
> -
> 

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to