General information
Category:
Windows API functions
Title:
System Power Status
Hi there
I'm trying to use the GetSystemPowerStatus call for use on a laptop when the power gets low. The structure is...
Type SYSTEM_POWER_STATUS
ACLineStatus As Byte
BatteryFlag As Byte
BatteryLifePercent As Byte
Reserved1 As Byte
BatteryLifeTime As Long
BatteryFullLifeTime As Long
End Type
My VFP code is...
DECLARE INTEGER GetSystemPowerStatus IN KERNEL32 STRING @lpStatus
lpStatus = REPLICATE(CHR(0), 12)
GetSystemPowerStatus(@lpStatus)
However, I'm having a bit of trouble converting the return string back to anything meaningful. All the conversion routines from Hex To Dec I've seen always return 0. I'm using NT sp4. Is this an NT thing or I am just being thick???
Cheers
Arthur
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only