See battery status

A

Arnaldo Fuziy

With your help, we've got to this function that is returning perfectly the
battery status (just translated from C# function sent by Alex Feinman). Is
there any way that we can see backup battery status (that one in the power
app in control panel)?

'--------------
'Returns battery status
<StructLayout(LayoutKind.Sequential)> _

Public Class SystemPowerStatus

Public ACLineStatus As Byte

Public BatteryFlag As Byte

Public BatteryLifePercent As Byte

Public Reserved1 As Byte

Public BatteryLifeTime As Long

Public BatteryFullLifeTime As Long

Public Reserved2 As Byte

Public BackupBatteryFlag As Byte

Public BackupBatteryLifePercent As Byte

Public Reserved3 As Byte

Public BackupBatteryLifeTime As Long

Public BackupBatteryFullLifeTime As Long

End Class

<DllImport("coredll.dll", EntryPoint:="GetSystemPowerStatusEx",
SetLastError:=True)> _

Public Function GetSystemPowerStatus(ByVal PowerStatus As SystemPowerStatus)
As Boolean

End Function

<DllImport("coredll.dll")> _

Public Function GetLastError() As Long

End Function
 
C

Chris Tacke, eMVP

There are several "BackupBattery..." members in what you posted. Are they
not providing what you need?

-Chris
 
P

Paul G. Tobey [eMVP]

I don't have any devices that use backup batteries, but the OEM of the
device is responsible for implementing the information about backup battery
status. What device is this? Does the Power Control Panel applet display a
backup battery status?

Paul T.
 
A

Arnaldo Fuziy

In my equipment, when I enter Control Panel, and look in Battery info, there
are two batteries: Main and "reserve"... I'd like the status of the reserve
battery...

Tks,
 
P

Paul G. Tobey [eMVP]

It seems like it should be possible, then. What sort of information is
given for the reserve battery? What device are we talking about?

Paul T.

Arnaldo Fuziy said:
In my equipment, when I enter Control Panel, and look in Battery info, there
are two batteries: Main and "reserve"... I'd like the status of the reserve
battery...

Tks,

"Paul G. Tobey [eMVP]" <[email protected]> escreveu na mensagem
I don't have any devices that use backup batteries, but the OEM of the
device is responsible for implementing the information about backup battery
status. What device is this? Does the Power Control Panel applet
display
a
backup battery status?

Paul T.

Are
they
 
A

Arnaldo Fuziy

It returns 0 for the reserve batteries... The device is an iPaq 2210...

Tks,


Paul G. Tobey said:
It seems like it should be possible, then. What sort of information is
given for the reserve battery? What device are we talking about?

Paul T.

Arnaldo Fuziy said:
In my equipment, when I enter Control Panel, and look in Battery info, there
are two batteries: Main and "reserve"... I'd like the status of the reserve
battery...

Tks,

"Paul G. Tobey [eMVP]" <[email protected]> escreveu na mensagem
I don't have any devices that use backup batteries, but the OEM of the
device is responsible for implementing the information about backup battery
status. What device is this? Does the Power Control Panel applet
display
a
backup battery status?

Paul T.

Unfortunately not, they all return zero...

Tks,

Arnaldo.

"Chris Tacke, eMVP" <[email protected]> escreveu na mensagem
There are several "BackupBattery..." members in what you posted. Are
they
not providing what you need?

-Chris


With your help, we've got to this function that is returning perfectly
the
battery status (just translated from C# function sent by Alex
Feinman).
Is
there any way that we can see backup battery status (that one in the
power
app in control panel)?

'--------------
'Returns battery status
<StructLayout(LayoutKind.Sequential)> _

Public Class SystemPowerStatus

Public ACLineStatus As Byte

Public BatteryFlag As Byte

Public BatteryLifePercent As Byte

Public Reserved1 As Byte

Public BatteryLifeTime As Long

Public BatteryFullLifeTime As Long

Public Reserved2 As Byte

Public BackupBatteryFlag As Byte

Public BackupBatteryLifePercent As Byte

Public Reserved3 As Byte

Public BackupBatteryLifeTime As Long

Public BackupBatteryFullLifeTime As Long

End Class

<DllImport("coredll.dll", EntryPoint:="GetSystemPowerStatusEx",
SetLastError:=True)> _

Public Function GetSystemPowerStatus(ByVal PowerStatus As
SystemPowerStatus)
As Boolean

End Function

<DllImport("coredll.dll")> _

Public Function GetLastError() As Long

End Function
 
C

Chris Tacke, eMVP

Yes, your API declaration is wrong.

--
Chris Tacke, eMVP
Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net

Arnaldo Fuziy said:
It returns 0 for the reserve batteries... The device is an iPaq 2210...

Tks,


"Paul G. Tobey [eMVP]" <[email protected]> escreveu na mensagem
It seems like it should be possible, then. What sort of information is
given for the reserve battery? What device are we talking about?

Paul T.

Arnaldo Fuziy said:
In my equipment, when I enter Control Panel, and look in Battery info, there
are two batteries: Main and "reserve"... I'd like the status of the reserve
battery...

Tks,

"Paul G. Tobey [eMVP]" <[email protected]> escreveu na mensagem
I don't have any devices that use backup batteries, but the OEM of the
device is responsible for implementing the information about backup
battery
status. What device is this? Does the Power Control Panel applet display
a
backup battery status?

Paul T.

Unfortunately not, they all return zero...

Tks,

Arnaldo.

"Chris Tacke, eMVP" <[email protected]> escreveu na
mensagem
There are several "BackupBattery..." members in what you posted. Are
they
not providing what you need?

-Chris


With your help, we've got to this function that is returning
perfectly
the
battery status (just translated from C# function sent by Alex
Feinman).
Is
there any way that we can see backup battery status (that one
in
the
power
app in control panel)?

'--------------
'Returns battery status
<StructLayout(LayoutKind.Sequential)> _

Public Class SystemPowerStatus

Public ACLineStatus As Byte

Public BatteryFlag As Byte

Public BatteryLifePercent As Byte

Public Reserved1 As Byte

Public BatteryLifeTime As Long

Public BatteryFullLifeTime As Long

Public Reserved2 As Byte

Public BackupBatteryFlag As Byte

Public BackupBatteryLifePercent As Byte

Public Reserved3 As Byte

Public BackupBatteryLifeTime As Long

Public BackupBatteryFullLifeTime As Long

End Class

<DllImport("coredll.dll", EntryPoint:="GetSystemPowerStatusEx",
SetLastError:=True)> _

Public Function GetSystemPowerStatus(ByVal PowerStatus As
SystemPowerStatus)
As Boolean

End Function

<DllImport("coredll.dll")> _

Public Function GetLastError() As Long

End Function
 
P

Paul G. Tobey [eMVP]

I guess what I'm asking is what does the Control Panel show for the reserve
battery? A percentage? Good/Low/Very Low?

Paul T.

Arnaldo Fuziy said:
It returns 0 for the reserve batteries... The device is an iPaq 2210...

Tks,


"Paul G. Tobey [eMVP]" <[email protected]> escreveu na mensagem
It seems like it should be possible, then. What sort of information is
given for the reserve battery? What device are we talking about?

Paul T.

Arnaldo Fuziy said:
In my equipment, when I enter Control Panel, and look in Battery info, there
are two batteries: Main and "reserve"... I'd like the status of the reserve
battery...

Tks,

"Paul G. Tobey [eMVP]" <[email protected]> escreveu na mensagem
I don't have any devices that use backup batteries, but the OEM of the
device is responsible for implementing the information about backup
battery
status. What device is this? Does the Power Control Panel applet display
a
backup battery status?

Paul T.

Unfortunately not, they all return zero...

Tks,

Arnaldo.

"Chris Tacke, eMVP" <[email protected]> escreveu na
mensagem
There are several "BackupBattery..." members in what you posted. Are
they
not providing what you need?

-Chris


With your help, we've got to this function that is returning
perfectly
the
battery status (just translated from C# function sent by Alex
Feinman).
Is
there any way that we can see backup battery status (that one
in
the
power
app in control panel)?

'--------------
'Returns battery status
<StructLayout(LayoutKind.Sequential)> _

Public Class SystemPowerStatus

Public ACLineStatus As Byte

Public BatteryFlag As Byte

Public BatteryLifePercent As Byte

Public Reserved1 As Byte

Public BatteryLifeTime As Long

Public BatteryFullLifeTime As Long

Public Reserved2 As Byte

Public BackupBatteryFlag As Byte

Public BackupBatteryLifePercent As Byte

Public Reserved3 As Byte

Public BackupBatteryLifeTime As Long

Public BackupBatteryFullLifeTime As Long

End Class

<DllImport("coredll.dll", EntryPoint:="GetSystemPowerStatusEx",
SetLastError:=True)> _

Public Function GetSystemPowerStatus(ByVal PowerStatus As
SystemPowerStatus)
As Boolean

End Function

<DllImport("coredll.dll")> _

Public Function GetLastError() As Long

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top