Re: WM_QUERYENDSESSION
From: KM (konstmor_at_nospam_yahoo.com)
Date: 07/27/04
- Next message: LIKAI: "what is the website for downloading available components"
- Previous message: George: "Re: Add which components can I start the Cryptographic Services?"
- In reply to: Ulf Jaenicke-Rößler: "Re: WM_QUERYENDSESSION"
- Next in thread: Ulf Jaenicke-Rößler: "Re: WM_QUERYENDSESSION"
- Reply: Ulf Jaenicke-Rößler: "Re: WM_QUERYENDSESSION"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 27 Jul 2004 01:53:35 -0700
Ulf,
I don't know what it the problem with WM_QUERYENDSESSION.
It would be good to know if it gets fired at all.
Add a handler for WM_ENDSESSION too. This way you will know if session end
message routine works on Minlogon at all.
However, the problem may be in receving the event in Minlogon image. Since
you are running under Local System account, the rules are a bit different.
Also, there is no real order control to catch the event (unless you set a
global hook on the message). So some other app (even Minlogon) can sit and
catch the message returning FALSE (0) and therefore canceling the session
end (the system stops sending WM_QUERYENDSESSION messages as soon as one
application returns zero).
Anyway, what you can do is try adding your application-defined
HandlerRoutine function (through SetConsoleCtrlHandler API) and catch
CTRL_SHUTDOWN_EVENT signal from system (shutdown of the system). By the
signal you can do whatever you need to do. But you may not be able to cancel
the shutdown, though.
Also, related to both approaches (WM_QUERYENDSESSION and
SetConsoleCtrlHandler), you can play with SetProcessShutdownParameters API
to set a different shutdown priority (level) for your process. Don't know if
it will make any difference on your image but may be worth to try.
KM
> Hi,
>
> KM wrote:
> > Ulf,
> >
> > How do you shotdown your runtime?
>
> Actually we have a shell application which the user can use to shutdown.
> Furthermore the user may push the power button.
> Both methods work fine. However, if the user decides to run Explorer as
> shell (it was a requirement to make that possible) he could use the
> Start button menu to shutdown.
> This too works quite well on Win2k and XP Pro, but on XPe there is no
> WM_QUERYSESSION :-(
>
> > I think normally, ExitWindowsEx sends out the WM_QUERYENDSESSION
mesasge.
>
> That's what I think too.
>
> > Try to call the API from your app and see if it works on your runtime.
>
> I wrote a little app that simply calls ExitWindowsEx (without EWXFORCE, of
> course) - no WM_QUERYENDSESSION either :-(
> BTW, xpepm -restart doesn't help as well.
>
> Thank you for helping,
> Ulf
- Next message: LIKAI: "what is the website for downloading available components"
- Previous message: George: "Re: Add which components can I start the Cryptographic Services?"
- In reply to: Ulf Jaenicke-Rößler: "Re: WM_QUERYENDSESSION"
- Next in thread: Ulf Jaenicke-Rößler: "Re: WM_QUERYENDSESSION"
- Reply: Ulf Jaenicke-Rößler: "Re: WM_QUERYENDSESSION"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|