Get Laptop Battery Meter Info

Just starting out? Need help? Post your questions and find answers here.
tkruk
User
User
Posts: 24
Joined: Sat Jun 07, 2003 1:29 am
Location: New York, USA

Get Laptop Battery Meter Info

Post by tkruk »

Hello...

Does anyone know how to retrieve power parameters
from a computer (laptop), to calculate Battery remaining???
(I guess total voltage, current voltage, etc...)

Any help greatly appreciated. Thanks!!!

Tom.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Get Laptop Battery Meter Info

Post by PB »

> Does anyone know how to retrieve power parameters from a computer
> (laptop), to calculate Battery remaining???

I don't have a laptop to test this with (it returns -1), but it should work. Also,
try replacing BatterLifePercent with BatteryLifeTime and BatteryFullLifeTime.

Can anyone confirm if it works with a laptop? Thanks!

Code: Select all

Laptop.SYSTEM_POWER_STATUS ; Custom structure to hold value.
GetSystemPowerStatus_(Laptop) ; Load structure with the value.
Debug Laptop\BatteryLifePercent ; Show relevant structure field.
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

Only BatteryLifePercent works fine here, all others fail with -1

cheers
Mike
Tranquil
Post Reply