Re: WM_ENDSESSION: See if its a restart or shutdown
From: Ken Wickes [MSFT] (kenwic_at_online.microsoft.com)
Date: 12/07/04
- Previous message: WRH: "Re: WM_ENDSESSION: See if its a restart or shutdown"
- In reply to: WRH: "Re: WM_ENDSESSION: See if its a restart or shutdown"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 6 Dec 2004 16:17:59 -0800
I'm curious how you are going to use this information. Just because the
machine is being restarted doesn't mean your service will run again. It
could be running a different operating system or a last known good config.
Seems like all you can do is treat the events the same and shut down the
external equipment.
-- Ken Wickes [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. "WRH" <no_spam_here@videotron.ca> wrote in message news:%23f3xT5%232EHA.2876@TK2MSFTNGP12.phx.gbl... > > "Thomas Johansen" <thrawn[NO SPAM]@hest.com___KĘP> wrote in message > news:OPqlWm62EHA.2608@TK2MSFTNGP10.phx.gbl... >>> I don't know if a windows service gets windows broadcast messages >>> but a standard windows app can process the WM_QUERYENDSESSION >>> message and stop the shutdown process if necessary >> >> Yes.. But can it see the difference between af shutdown and a restart ? > > > I could'nt find any info on that. If unable to determine if shutdown or > restart > was used, a workaround may be to intercept the WM_QUERYENDSESSION > message, return 0, then ask the user again if its a shutdown or restart. > and use ExitWindowsEx accordingly. > > > >> >>> >>> Hope this helps >>> >>> >>> "Thomas Johansen" <thrawn[NO SPAM]@hest.com___KĘP> wrote in message >>> news:OIoT7vR2EHA.1524@TK2MSFTNGP09.phx.gbl... >>> > Hi >>> > >>> > I need my Windows Service to know when the system is shutting down. >>> > But >> it >>> > has allso to know if its a reboot or a shutdown !!! >>> > >>> > Is there any way of see this ?? I could use the WM_ENDSESSION and then >> see >>> > if its a restart or shutdown >>> > >>> > I need to tell some eksternal equipment, connect on the COM port, that >> the >>> > PC is shutting down of restarted !!! >>> > Thomas >>> > >>> > >>> > >>> > >>> >>> >> >> > >
- Previous message: WRH: "Re: WM_ENDSESSION: See if its a restart or shutdown"
- In reply to: WRH: "Re: WM_ENDSESSION: See if its a restart or shutdown"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading