次の方法で共有


BatteryDrvrGetLevels (Compact 2013)

3/26/2014

This function returns the number of levels that the battery driver is capable of returning in the BatteryFlag and BackupBatteryFlag members of the SYSTEM_POWER_STATUS_EX2 structure.

Syntax

LONG BatteryDrvrGetLevels(void);

Parameters

None.

Return Value

Contains the number of levels that the GetSystemPowerStatusEx2 function can return in the BatteryFlag member of SYSTEM_POWER_STATUS_EX2. The low-order WORD contains the number of levels that this function can return for the main battery, and the high-order WORD contains the number of levels that this function can return for the backup battery.

The number of levels that this function can return ranges from zero through 3. For example, if only the two values BATTERY_FLAG_HIGH and BATTERY_FLAG_LOW can be returned, the return value is 2. If this function can also return BATTERY_FLAG_CRITICAL, the value is 3. The BATTERY_FLAG_CHARGING, BATTERY_FLAG_NO_BATTERY, and BATTERY_FLAG_UNKNOWN values are ignored for the purposes of this count.

Remarks

In this example of BatteryDrvrGetLevels, the function takes no arguments. This function returns the number of levels that the battery driver can return in the BatteryFlag and BackupBatteryFlag members of the SYSTEM_POWER_STATUS_EX2 structure.

Requirements

Header

battery.h

Library

coredll.lib

See Also

Reference

Battery Driver Functions

Other Resources

GetSystemPowerStatusEx2
SYSTEM_POWER_STATUS_EX2