Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
System Power Status
Message
From
05/04/2000 14:17:55
 
 
To
05/04/2000 08:49:14
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00355606
Message ID:
00355820
Views:
17
>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???
>

Do yourself a favor and look at the SysInfo ActiveX control. It's referenced in the VFP OnLine Help file and is easier to use for VFP 6 at least - look for the topic SysInfo control.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform