BatteryPDDGetStatus

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.

Requirements

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

See Also

Battery Drivers | BatteryDrvrSupportsChangeNotification | SYSTEM_POWER_STATUS_EX2

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.