Re: Determining if a laptop has AC power



I was looking for a much simpler way... nothing as simple as a status in the
registry somewhere? I would hate to have to add more code to make this work.
Might have to just give a warning that it "should be plugged in", and hope
it is.

"David Candy" wrote:

>
>
> Platform SDK: Hardware
>
> GetSystemPowerStatus
> The GetSystemPowerStatus function retrieves the power status of the system. The status indicates whether the system is running on AC or DC power, whether the battery is currently charging, and how much battery life remains.
>
> BOOL GetSystemPowerStatus(
> LPSYSTEM_POWER_STATUS lpSystemPowerStatus
> );Parameters
> lpSystemPowerStatus
> [out] Pointer to a SYSTEM_POWER_STATUS structure that receives status information.
> Return Values
> If the function succeeds, the return value is nonzero.
>
> If the function fails, the return value is zero. To get extended error information, call GetLastError.
>
> Requirements
> Windows NT/2000/XP: Included in Windows 2000 and later.
> Windows 95/98/Me: Included in Windows 95 and later.
> Header: Declared in Winbase.h; include Windows.h.
> Library: Use Kernel32.lib.
>
> See Also
> Power Management Overview, Power Management Functions, SYSTEM_POWER_STATUS
>
>
> Platform SDK Release: August 2001 What did you think of this topic?
> Let us know. Order a Platform SDK CD Online
> (U.S/Canada) (International)
>
>
>
> Requirements
> Windows NT/2000/XP: Included in Windows 2000 and later.
> Windows 95/98/Me: Included in Windows 95 and later.
> Header: Declared in Winbase.h; include Windows.h.
> Library: Use Kernel32.lib.
>
> See Also
> Power Management Overview, Power Management Functions, SYSTEM_POWER_STATUS
>
>
> --
> ----------------------------------------------------------
>
> "Legacy" <Legacy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:91C0BA64-43B6-4128-AFD4-1E33A645770A@xxxxxxxxxxxxxxxx
> > Thanks for the reply. Unfortunately, that doesn't help me. If I was there
> > to place a CD in 15k+ drives, I'd be able to see if it was plugged in. I
> > need to have a registry key to be able to determine (scriptomatically) if it
> > has AC power or not. This will be an automated rollout. The end user just
> > puts the DVD in the drive, and off go all the updates...
> >
> > "bumtracks" wrote:
> >
> >> plug in & boot off a knoppix CD and it magically knows without lookin in
> >> the hard drive or in windows registry if you're on battery or not.
> >>
> >> windows somewhere tells me my laptops state of dock is unknown,
> >> and wants me to tell it if its running on battery or not.
> >> It's the only 'I don't know' checkbox I've ever seen auto configured.
> >>
> >>
> >>
> >> "Legacy" <Legacy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> news:B05406A8-9A09-44A6-9B16-C8C3BA1A9F4B@xxxxxxxxxxxxxxxx
> >> > Hey guys... we are preparing remote installations of Windows XP SP2 for
> >> > 15k+
> >> > laptops... at issue is the AC power... we have been using the key:
> >> >
> >> > HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\SysTray\Services
> >> >
> >> > Historically, for us, a value of 30 means on AC, 31 means not on AC.
> >> >
> >> > However, all of a sudden, as we reach final stages of development, we find
> >> > some machines aren't adhering to this... and multiple types of laptops.
> >> >
> >> > Is there a BETTER key/method?
> >> >
> >> > Thanks in advance.
> >> >
> >> > (Long time listener, first time caller)
> >>
> >>
> >>
.



Relevant Pages

  • Re: Macbook Pro power management seems broken...
    ... even though I have gone in and set the power management profile to "Custom" and told it to Never shut the system down when idle it will shut down anyway. ... do you really mean "go to sleep"? ... As such, it should not happen at any time other than when you lose AC power, or the battery goes dead if not plugged into the brick. ... When you close the lid to your MacBook Pro, the machine will go to sleep and this is normal behavior. ...
    (comp.sys.mac.system)
  • Re: Damaging batteries?
    ... after a couple of hours of recharge it just lasted 20 ... i reapeated the cycle and I got the same results. ... It really looks like the power management is ... A real new battery or some cheap knock-off you found somewhere ...
    (comp.sys.laptops)
  • Re: MCE 2005, MCE 2005 Remote, S3 sleep mode.
    ... come out of standby by following jelle's instructions, but the remote ... > edit these lines into your registry. ... > can find this in the power management of the bios. ... >> The Batcave Forums ...
    (microsoft.public.windows.mediacenter)
  • RE: MCE 2005, MCE 2005 Remote, S3 sleep mode.
    ... Windows Registry Editor Version ... Now you can let the PC come out of an S3 status with the remote ... can find this in the power management of the bios. ... > The Batcave Forums ...
    (microsoft.public.windows.mediacenter)
  • Re: Battstat applet
    ... This is a rather critical applet for me so I can see in a blink of an eye how much time I have left on battery. ... I am not at all interested in automatic power management functions, ...
    (Fedora)