获取电脑电池电量信息的函数。。

发布时间:2025-01-11 20:44

如果可能,使用电池供电的收音机获取最新信息。 #生活常识# #应急生存技巧# #停电应急预案#

获取电脑电池电量信息的函数。。

最新推荐文章于 2024-10-15 21:55:29 发布

shen_wei 于 2016-11-14 15:59:06 发布

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

BOOL WINAPI GetSystemPowerStatus(

__out LPSYSTEM_POWER_STATUS lpSystemPowerStatus

);

typedef struct _SYSTEM_POWER_STATUS { BYTE ACLineStatus; BYTE BatteryFlag; BYTE BatteryLifePercent; BYTE Reserved1; DWORD BatteryLifeTime; DWORD BatteryFullLifeTime;

} SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS;


Members

ACLineStatus

The AC power status. This member can be one of the following values.

Value Meaning

0

Offline

1

Online

255

Unknown status

BatteryFlag

The battery charge status. This member can contain one or more of the following flags.

Value Meaning

1

High—the battery capacity is at more than 66 percent

2

Low—the battery capacity is at less than 33 percent

4

Critical—the battery capacity is at less than five percent

8

Charging

128

No system battery

255

Unknown status—unable to read the battery flag information

The value is zero if the battery is not being charged and the battery capacity is between low and high.

BatteryLifePercent

The percentage of full battery charge remaining. This member can be a value in the range 0 to 100, or 255 if status is unknown.

Reserved1

Reserved; must be zero.

BatteryLifeTime

The number of seconds of battery life remaining, or –1 if remaining seconds are unknown.

BatteryFullLifeTime

The number of seconds of battery life when at full charge, or –1 if full battery lifetime is unknown.

SYSTEM_POWER_STATUS sysPower = {0};

GetSystemPowerStatus(&sysPower);

网址:获取电脑电池电量信息的函数。。 https://www.yuejiaxmz.com/news/view/692812

相关内容

如何使用JS获取系统内存、CPU/GPU、电量等信息 « 张鑫旭
如何在电脑上抽数字
信息爆炸时代:电子产品如何塑造我们的信息获取方式
电池知识:数码产品电池的保养及维护技巧
信息的来源与获取使用.ppt
如何取消电脑的节电模式
电脑时空:信息化时代的幸福生活
怎样保养电脑和手机和电池
【电动车充电站价格 服务/价格信息】
充电电池容量测试仪实现方案

随便看看