I understand it should be similar to the following code:
[Code]
type
TSystemPowerStatus = {???};
function GetBattery(SYSTEM_POWER_STATUS: TSystemPowerStatus): Boolean;
external 'GetSystemPowerStatus@Kernel32.dll stdcall';
procedure ShowBatteryStatus();
var
PowerStatus: TSystemPowerStatus;
State: String;
begin
GetBattery(PowerStatus);
State := IntToStr(PowerStatus.BatteryLifePercent);
MsgBox(format('Battery Precents: %p',[State]), mbInformation, MB_OK);
end;
function InitializeSetup: Boolean;
begin
ShowBatteryStatus()
Result := True
end;
But I could not find the right type for TSystemPowerStatus.
The struct type is not recognized.
Can anyone help with this?
Thank you!