Re: another (new?) Power button problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: KM (konstmor_at_nospam_yahoo.com)
Date: 07/22/04


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



Relevant Pages

  • Re: AT&T Tilt continues the tradition of crappy Windows Mobile phones; what phone can I buy ins
    ... reason), give the XDA-Devs cooked ROM's a try. ... the iPhone is ruled out because tethering my ... the network through my phone, EDGE-only is simply not an option. ... settings was invalid because of a corrupt ring tone, ...
    (microsoft.public.pocketpc)
  • Re: DVD disks driving me mad
    ... > reason if it *wasn't* asctually there! ... also explains why the Nero Burning Rom didn't show up on the start ... > & that same Option is now available in WinXP, ... > Settings of the ordinary WinXP Start Menu!!! ...
    (uk.people.silversurfers)
  • Re: DVD disks driving me mad
    ... good reason if it *wasn't* asctually there! ... also explains why the Nero Burning Rom didn't show up on the start ... I don't think that it's the *Program* that's doing the Hiding? ... Settings of the ordinary WinXP Start Menu!!! ...
    (uk.people.silversurfers)
  • Re: KDE 3.5.10 Desktop Background Issue
    ... Is there a command to get kde to reload all user settings without ... but I planned to evade that (the reason for my ... Removing that part does the trick. ...
    (Fedora)
  • Re: (Andy Hewitt) Re: BT HomeHub + BBC iPlayer disconnects
    ... Yeah, I knew about that - one reason I've been thinking that the time ... problem with my settings because it was working perfectly well two days ... just tell me what you want: this email client ...
    (uk.comp.sys.mac)