Re: WM_ENDSESSION: See if its a restart or shutdown

From: Ken Wickes [MSFT] (kenwic_at_online.microsoft.com)
Date: 12/07/04

  • Next message: Unicorn: "Language Pack"
    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
    >>> >
    >>> >
    >>> >
    >>> >
    >>>
    >>>
    >>
    >>
    >
    > 
    

  • Next message: Unicorn: "Language Pack"

    Relevant Pages

    • Regression in gdm-2.18 since 2.6.24
      ... kernels newer than 2.6.24 break gdm's shutdown (and ... choose 'shutdown' or 'restart' from gdm, ... either the drm patches or i2c-viapro. ... I tried reverting only the second hunk (I didn't ...
      (Linux-Kernel)
    • Re: Regression in gdm-2.18 since 2.6.24
      ... kernels newer than 2.6.24 break gdm's shutdown (and ... choose 'shutdown' or 'restart' from gdm, ... either the drm patches or i2c-viapro. ... I tried reverting only the second hunk (I didn't ...
      (Linux-Kernel)
    • Shutdown & Restart
      ... causing his shutdown problems and error conditions. ... reboots on shutdown if APM is enabled, ... USB Connections As can be seen from remarks in the Misc. ... XP will restart instead of shut down. ...
      (microsoft.public.windowsxp.general)
    • Re: Diff. between Shutdown and Restart
      ... >>is similar to shutting down, only you don't have to turn it back on again. ... > system performs an orderly shutdown, ... > When you just press the reset button, the system will restart, but you ... > their state when you hit the reset button. ...
      (microsoft.public.windowsxp.general)
    • RE: Remove "Shutdown" command from w2k PCs but enable restart
      ... would have to field these calls instead of their users able to reboot on ... chase after them to only restart a system at night. ... I use the command line shutdown for the few machines that I have removed ... I also adjusted the bios power on options to deal with a power outage .. ...
      (Focus-Microsoft)

    Loading