Re: Poweroff / shell
- From: "KM" <konstmor@xxxxxxxxxxxxxxxx>
- Date: Tue, 12 Jun 2007 16:29:54 -0700
Rob,
IIRC, it was not the Explorer but Winlogon that handled that broadcast and called to ExitWindow[Ex] API.
An old version of Minlogon was handling that message correctly as well, however that functionality got broken (or excluded) in newer
version.
You can verify if the above is true by reading lots of related threads in this NG archive.
Anyway, if you are running your own application as the shell you can always "fix" the behavior by providing your own handler for the
WM_POWERBROADCAST message. Basically if you catch the message by your window or thread proc, you should call a shutting the system
down API such as InitiateSystemShutdown, ExitWindowsEx, NTShutdownSystem (the fastest shutdown but not graceful), etc. Make sure
your app is granted SE_SHUTDOWN_NAME privilege first.
Or you can just execute command such as "xpepm.exe -shutdown" (Power Management Application component) or "fba -shutdown" or
"shutdown.exe -s -t 00 -f" if you prefer.
Some more info and ways how to intercept the power management events you can find in this thread:
http://groups.google.com/group/microsoft.public.windowsxp.embedded/browse_thread/thread/0d300155d7c44bbe
--
=========
Regards,
KM
Hi,
My Winxp embedded image that does NOT run Explorer.exe is not responding to
the power-off as it should. Am I correct in assuming that Explorer.exe
responds to the WM_POWERBROADCAST message, by shutting down the system ?
Now the system powers down "hard" (suddenly) after keeping the powerbutton
pressed 4 sec, without shutting dowbn nicely. When explorer.exe is running it
shuts down nicely. I need to add this behaviour to my app.
Any tips ?
Greetings,
Rob.
.
- Follow-Ups:
- Re: Poweroff / shell
- From: Rob
- Re: Poweroff / shell
- Prev by Date: Re: Image with 1394 Netcard
- Next by Date: Re: Unable to access configuration for microsoft personal web serv
- Previous by thread: Re: Unable to access configuration for microsoft personal web server
- Next by thread: Re: Poweroff / shell
- Index(es):
Relevant Pages
|