Share via


BatteryPDDGetStatus (Windows CE 5.0)

Send Feedback

This function obtains the most current battery and power status available on the platform. It fills in the structures pointed to by its parameters.

BOOL WINAPI BatteryPDDGetStatus(  PSYSTEM_POWER_STATUS_EX2 pstatus,  PBOOL pfBatteriesChangedSinceLastCall);

Parameters

  • pstatus
    [out] Pointer to a SYSTEM_POWER_STATUS_EX2 structure.
  • pfBatteriesChangedSinceLastCall
    [out] Pointer to a flag that the function sets to TRUE if the user replaced or changed the system's batteries since the last call to this function. The battery drivers should only set this value to TRUE if the driver's BatteryDrvrSupportsChangeNotification implementation returns TRUE.

Return Values

Returns TRUE if successful. Returns FALSE if there is an error. On failure, this routine should record its failure reason using SetLastError.

Remarks

When implementing BatteryPDDGetStatus, the appropriate battery information fills in the SYSTEM_POWER_STATUS_EX2 structure. Declare a variable of type SYSTEM_POWER_STATUS_EX2 as a pointer to the return buffer containing the battery status information. The pfBatteriesChangedSinceLastCall parameter is a pointer to the flag and is set to TRUE if the user replaced or changed the system's batteries since the last call to this function.

To return additional battery information, such as information about an extra battery, provide a data buffer larger than SYSTEM_POWER_STATUS_EX2 in the GetSystemPowerStatusEx2 function. Any extra information must be added after the BatteryChemistry member of the SYSTEM_POWER_STATUS_EX2 structure. There must be support for this implemented in the battery driver, and the implementation of this support varies depending on the hardware platform.

Requirements

OS Versions: Windows CE .NET 4.2 and later.
Header: Battimpl.h.
Link Library: Statically linked to the battery driver MDD.

See Also

BatteryDrvrSupportsChangeNotification | SYSTEM_POWER_STATUS_EX2

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.