Why will this batterystatus API work in winxp, but not in nt4.0?
Code:
Type SYSTEM_POWER_STATUS
ACLineStatus As Byte
BatteryFlag As Byte
BatteryLifePercent As Byte
Reserved1 As Byte
BatteryLifeTime As Long
BatteryFullLifeTime As Long
End Type
Declare Function GetSystemPowerStatus Lib "kernel32.dll" (lpSystemPowerStatus As SYSTEM_POWER_STATUS) As Long
Dim SysPower As SYSTEM_POWER_STATUS
GetSystemPowerStatus SysPower
With this code, SysPower.BatteryLifePercent returns 0 in nt 4.0.. but it works properly in winxp..
anyone know how i can get this to work with nt 4.0?
It also works in 9x..