Thanks for that.  It now seems to work using the WM_QUERYENDSESSION
althrough sometimes it stops windows from shutting down...

It's interesting. I always assumed that when windows shut your programs
down when you shut down the machine that it would run your On_Close
events for the main form...  I guess you learn something every day.

Steve

>>> [EMAIL PROTECTED] 30/01/2004 12:34:59 p.m. >>>

The WM_QUERYENDSESSION is only meant for you to popup a confirm save,
cancel
type dialogbox.  All lengthy code should be run here, though be warned
that
Windows can still kill application that takes too long to handle
message
(the user could get the "application not responding message").  Limit
your
processing to 5 seconds or less.  It is not a good time to be updating
the
database because if Windows decides to pull the rug from under your
application, you could end up with a corrupt database.

The WM_ENDSESSION message is purely a notification message, and Windows
can
shutdown at anytime after you receive the message.  Its purpose is
solely to
tell your application that it should not do any more processing.

----- Original Message -----
From: "Steve Aish" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 30, 2004 11:43 AM
Subject: Re: [DUG] Running events on shutdown


> Update:
>
> After more investigation it seems that these do actually work on shut
down

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

Reply via email to