Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

SYSTEM_POWER_STATUS_EX (coredll)
 

coredll is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for SYSTEM_POWER_STATUS_EX in other DLLs exists, click on Find References to the right.

.
Summary
This structure contains information about the power status of the system.

C# Definition:

[StructLayout(LayoutKind.Sequential)]
internal class SYSTEM_POWER_STATUS_EX
{
   public byte ACLineStatus = 0;
   public byte BatteryFlag = 0;
   public byte BatteryLifePercent = 0;
   public byte Reserved1 = 0;
   public uint BatteryLifeTime = 0;
   public uint BatteryFullLifeTime = 0;
   public byte Reserved2 = 0;
   public byte BackupBatteryFlag = 0;
   public byte BackupBatteryLifePercent = 0;
   public byte Reserved3 = 0;
   public uint BackupBatteryLifeTime = 0;
   public uint BackupBatteryFullLifeTime = 0;
   public BYTE ACLineStatus = 0;
   public BYTE BatteryFlag = 0;
   public BYTE BatteryLifePercent = 0;
   public BYTE Reserved1 = 0;
   public DWORD BatteryLifeTime = 0;
   public DWORD BatteryFullLifeTime = 0;
   public BYTE Reserved2 = 0;
   public BYTE BackupBatteryFlag = 0;
   public BYTE BackupBatteryLifePercent = 0;
   public BYTE Reserved3 = 0;
   public DWORD BackupBatteryLifeTime = 0;
   public DWORD BackupBatteryFullLifeTime = 0;
}

VB Definition:

Structure SYSTEM_POWER_STATUS_EX
   Public ACLineStatus As Byte
   Public BatteryFlag As Byte
   Public BatteryLifePercent As Byte
   Public Reserved1 As Byte
   Public BatteryLifeTime As Int32
   Public BatteryFullLifeTime As Int32
   Public BatteryLifeTime As Int16
   Public BatteryFullLifeTime As Int16
   Public Reserved2 As Byte
   Public BatteryBackupFlag As Byte
   Public BackupBatteryLifePercent As Byte
   Public BackupBatteryLifeTime As Byte
   Public Reserved3 As Byte
   Public BackupBatteryLifeTime As Int32
   Public BackupBatteryFullLifeTime As Int32
   Public BackupBatteryLifePercent As Byte
   Public BackupBatteryFullLifeTime As Byte
End Structure

User-Defined Field Types:

None.

Notes:

ACLineStatus

AC power status. It is one of the following values.

Value Description
0 Offline
1 Online
2 Backup
255 Unknown status

All other values are reserved.

C# Definition:

const byte AC_LINE_OFFLINE  = 0x00;
const byte  AC_LINE_ONLINE  = 0x01;
const byte AC_LINE_BACKUP_POWER  = 0x02;
const byte AC_LINE_UNKNOWN  = 0xFF;
const uint AC_LINE_OFFLINE  = 0x00;
const uint AC_LINE_ONLINE  = 0x01;
const uint AC_LINE_BACKUP_POWER  = 0x02;
const uint AC_LINE_UNKNOWN  = 0xFF;

BatteryFlag

    Battery charge status. It can be a combination of the following values:

    • BATTERY_FLAG_HIGH
    • BATTERY_FLAG_CRITICAL
    • BATTERY_FLAG_CHARGING
    • BATTERY_FLAG_NO_BATTERY
    • BATTERY_FLAG_UNKNOWN
    • BATTERY_FLAG_LOW
BatteryLifePercent

    Percentage of full battery charge remaining. This member can be a value in the range 0 to 100, or 255 if status is unknown. All other values are reserved.

Reserved1

    Reserved; set to zero.

BatteryLifeTime

    Number of seconds of battery life remaining, or 0xFFFFFFFF if remaining seconds are unknown.

BatteryFullLifeTime

    Number of seconds of battery life when at full charge, or 0xFFFFFFFF if full lifetime is unknown.

Reserved2

    Reserved; set to zero.

BackupBatteryFlag

    Backup battery charge status. It can be a combination of the following values:

    • BATTERY_FLAG_HIGH
    • BATTERY_FLAG_CRITICAL
    • BATTERY_FLAG_CHARGING
    • BATTERY_FLAG_NO_BATTERY
    • BATTERY_FLAG_UNKNOWN
    • BATTERY_FLAG_LOW
C# Definition:

const byte BATTERY_FLAG_HIGH  = 0x01;
const byte BATTERY_FLAG_LOW  = 0x02;
const byte BATTERY_FLAG_CRITICAL  = 0x04;
const byte BATTERY_FLAG_CHARGING  = 0x08;
const byte BATTERY_FLAG_NO_BATTERY  = 0x80;
const byte BATTERY_FLAG_UNKNOWN  = 0xFF;
const byte BATTERY_PERCENTAGE_UNKNOWN  = 0xFF;
const uint BATTERY_FLAG_HIGH  = 0x01;
const uint BATTERY_FLAG_LOW  = 0x02;
const uint BATTERY_FLAG_CRITICAL  = 0x04;
const uint BATTERY_FLAG_CHARGING  = 0x08;
const uint BATTERY_FLAG_NO_BATTERY  = 0x80;
const uint BATTERY_FLAG_UNKNOWN  = 0xFF;
const uint BATTERY_PERCENTAGE_UNKNOWN  = 0xFF;
const uint BATTERY_LIFE_UNKNOWN  = 0xFFFFFFFF;

BackupBatteryLifePercent

    Percentage of full backup battery charge remaining. Must be in the range 0 to 100, or BATTERY_PERCENTAGE_UNKNOWN.

Reserved3

    Reserved; set to zero

BackupBatteryLifeTime

    Number of seconds of backup battery life remaining, or BATTERY_LIFE_UNKNOWN if remaining seconds are unknown.

BackupBatteryFullLifeTime

    Number of seconds of backup battery life when at full charge, or BATTERY_LIFE_UNKNOWN if full lifetime is unknown.

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions