_SYSTEM_POWER_STATUS = packed record ACLineStatus : Byte; {0:电源断电; 1:电源正常; 255:电源状态未知} BatteryFlag : Byte; {1:电量充⾜; 2:电量低; 4:电池基本耗尽; 8:充电; 128:没有电池; 255:电池状态未知} BatteryLifePercent : Byte; {0..100:所剩电量百分数...
BOOL GetSystemPowerStatus( [out] LPSYSTEM_POWER_STATUS lpSystemPowerStatus ); 参数[out] lpSystemPowerStatus指向接收状态信息的 SYSTEM_POWER_STATUS 结构的指针。返回值如果该函数成功,则返回值为非零值。如果函数失败,则返回值为零。 要获得更多的错误信息,请调用 GetLastError。注解若...
GetSystemPowerStatus(&lpPwrStatus);然后可以使用lpPwrStatus中的数据。SYSTEM_POWER_STATUS的定义:typedef struct _SYSTEM_POWER_STATUS { BYTE ACLineStatus;BYTE BatteryFlag;BYTE BatteryLifePercent;BYTE Reserved1;DWORD BatteryLifeTime;DWORD BatteryFullLifeTime;} SYSTEM_POWER_STATUS, *LPSYSTEM_...
GetSystemPowerStatus 函数 检索系统的电源状态。状态指示系统是使用 AC 还是 DC 电源运行、电池当前是否正在充电、剩余的电池寿命以及节电模式是打开还是关闭。 函数签名如下: 代码语言:javascript 复制 BOOL GetSystemPowerStatus( [out] LPSYSTEM_POWER_STATUS lpSystemPowerStatus ); 参数: [out] lpSystemPowerStatus...
This function retrieves battery status information.SyntaxCopy DWORD GetSystemPowerStatusEx2( PSYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx2, DWORD dwLen, BOOL fUpdate ); ParameterspSystemPowerStatusEx2 [out] Pointer to a buffer that receives power status information....
This function retrieves the power status of the system. The status indicates whether the system is running on AC or DC power, whether or not the batteries are currently charging, and the remaining life of main and backup batteries.A remote application interface (RAPI) version of this function...
//TSystemPowerStatus 是 _SYSTEM_POWER_STATUS 结构的重定义: _SYSTEM_POWER_STATUS = packed record ACLineStatus : Byte; {0:电源断电; 1:电源正常; 255:电源状态未知} BatteryFlag : Byte; {1:电量充足; 2:电量低; 4:电池基本耗尽; 8:充电; 128:没有电池; 255:电池状态未知} ...
//举例:procedureTForm1.FormCreate(Sender: TObject);varPower: TSystemPowerStatus;beginGetSystemPowerStatus(Power); Memo1.Clear;withMemo1.LinesdobeginAdd(Format('电源状态: %d',[Power.ACLineStatus])); Add(Format('电池状态: %d',[Power.BatteryFlag])); ...
Retrieves the power status of the system. The status indicates whether the system is running on AC or DC power, whether the battery is currently charging, how much battery life remains, and if battery saver is on or off. Syntax C++ Copy BOOL GetSystemPowerStatus( [out] LPSYSTEM_POWER_...