Board index » delphi » Detecting Windows Shutdown?

Detecting Windows Shutdown?

How can I detect that Windows (Win2K in this case) is about to shutdown?

Thanks!
Jim

 

Re:Detecting Windows Shutdown?


The screen says "Windows is now shutting down"!
Sorry, couldn't resist.
Quote
"Jim Elden" <x@yz> wrote in message news:3a1292fe_1@dnews...
> How can I detect that Windows (Win2K in this case) is about to shutdown?

> Thanks!
> Jim

Re:Detecting Windows Shutdown?


Quote
On Wed, 15 Nov 2000 08:43:14 -0500, "Jim Elden" <x@yz> wrote:
>How can I detect that Windows (Win2K in this case) is about to shutdown?

Intercept "WM_QUERYENDSESSION".
(AFAIK it should work under 2K too).

--
Andrea Laforgia (ICQ 87230455)

Re:Detecting Windows Shutdown?


On Wed, 15 Nov 2000 14:07:05 -0000, "William Buchanan"

Quote
<william.bucha...@bdml.co.uk> wrote:
>The screen says "Windows is now shutting down"!
>Sorry, couldn't resist.

Wrong.
"is now shutting down" is not equivalent to "is about to shutdown".

;)

--
Andrea Laforgia (ICQ 87230455)

Re:Detecting Windows Shutdown?


Quote
>>The screen says "Windows is now shutting down"!<<

LOL!

How about in code, IOW does Windows post a WM_ message that I can catch
before it shuts down?

Re:Detecting Windows Shutdown?


Goto http://delphi.about.com/bltip0500.htm?terms=shut+down

Ta
Geoff

Re:Detecting Windows Shutdown?


Quote
Jim Elden wrote:
> >>The screen says "Windows is now shutting down"!<<

> LOL!

> How about in code, IOW does Windows post a WM_ message that I can
catch
> before it shuts down?

WM_QUERYENDSESSION, WM_ENDSESSION or none.

You'll find some explanations in Win32 help, at ExitWindowsEx().

-ThomasN

Other Threads