Re: another (new?) Power button problem
From: KM (konstmor_at_nospam_yahoo.com)
Date: 07/22/04
- Next message: Sean Gahan: "Touch Screen"
- Previous message: Andy Allred [MS]: "Re: XPE Security - virus and hacker attacs"
- In reply to: Ulf Jaenicke-Rößler: "Re: another (new?) Power button problem"
- Next in thread: Ulf Jaenicke-Rößler: "Re: another (new?) Power button problem"
- Reply: Ulf Jaenicke-Rößler: "Re: another (new?) Power button problem"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Jul 2004 08:55:56 -0700
Hi Ulf,
The reason why I asked you about the PM settings were the policies.
Anyway, you have figured this already out with Slobodan (I slept the entire
conversation :-) ).
Btw, I prefer calling CallNtPowerInformation(SystemPowerPolicyCurrent, ...),
in the SYSTEM_POWER_POLICY structure I change PowerButton field (flags that
you mentioned below).
But it does not really matter for you sicnce
WritePwrScheme/SetActivePwrScheme overwrite the policy scheme settings
anyway.
KM
> Slobodan Brcin (eMVP) wrote:
>
> > I expected that with new minlogon that support power buttons this
message will get consumed by minlogon handler.
> >
> > I guess that these registry changes you set in the first place, made all
OS-es uninterested in WM_POWERBROADCAST and that it was a
> > reason why it worked at your place.
>
> After reading a bit in the SDK, this code, executed at specific moments or
if
> necessary, does the magic - also with the new Minlogon, btw:
>
> BOOLEAN b;
> UINT i;
> GLOBAL_POWER_POLICY GlobalPowerPolicy;
>
> b=ReadGlobalPwrPolicy(&GlobalPowerPolicy);
> GlobalPowerPolicy.user.PowerButtonAc.Action=PowerActionShutdownOff;
> GlobalPowerPolicy.user.PowerButtonAc.Flags=POWER_ACTION_QUERY_ALLOWED |
POWER_ACTION_UI_ALLOWED;
> GlobalPowerPolicy.user.PowerButtonAc.EventCode=0;
>
> b=GetActivePwrScheme(&i);
> b=SetActivePwrScheme(i,&GlobalPowerPolicy,NULL);
>
> (Action became PowerActionNone and EventCode became
POWER_USER_NOTIFY_SHUTDOWN,
> although I'm unsure what the latter means. And yes, `b' is for error
checking.)
>
> Greetings
> Ulf
- Next message: Sean Gahan: "Touch Screen"
- Previous message: Andy Allred [MS]: "Re: XPE Security - virus and hacker attacs"
- In reply to: Ulf Jaenicke-Rößler: "Re: another (new?) Power button problem"
- Next in thread: Ulf Jaenicke-Rößler: "Re: another (new?) Power button problem"
- Reply: Ulf Jaenicke-Rößler: "Re: another (new?) Power button problem"
- Messages sorted by: [ date ] [ thread ]