Title: Message
You 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 -----
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
------------------------------------------------------------------------
 

Reply via email to