Les dejo el codigo de la api segun la apiguide 3.7:
Código
Private Type SYSTEM_POWER_STATUS ACLineStatus As Byte BatteryFlag As Byte BatteryLifePercent As Byte Reserved1 As Byte BatteryLifeTime As Long BatteryFullLifeTime As Long End Type Private Declare Function GetSystemPowerStatus Lib "kernel32" (lpSystemPowerStatus As SYSTEM_POWER_STATUS) As Long Private Sub Form_Paint() 'KPD-Team 2000 'URL: http://www.allapi.net/ 'E-Mail: KPDTeam@Hotmail.com Dim SPS As SYSTEM_POWER_STATUS 'get the battery powerstatus GetSystemPowerStatus SPS Me.AutoRedraw = True 'show some information Select Case SPS.ACLineStatus Case 0 Me.Print "AC power status: Offline" Case 1 Me.Print "AC power status: OnLine" Case 2 Me.Print "AC power status: Unknown" End Select Select Case SPS.BatteryFlag Case 1 Me.Print "Battery charge status: High" Case 2 Me.Print "Battery charge status: Low" Case 4 Me.Print "Battery charge status: Critical" Case 8 Me.Print "Battery charge status: Charging" Case 128 Me.Print "Battery charge status: No system battery" Case 255 Me.Print "Battery charge status: Unknown Status" End Select End Sub
El problema es que si tengo la bateria cargando me devuelve 9 como flag y no 8 :S.
Saben porque sera?
Muchas gracias por su ayuda