SPECIAL OFFER        Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming!

⤷ Get power status

Use GetSystemPowerStatus function and SYSTEM_POWER_STATUS structure.

procedure TForm1.Button1Click(Sender: TObject);
var
  PowerStatus: TSystemPowerStatus;
begin
  GetSystemPowerStatus(PowerStatus);
  if PowerStatus.ACLineStatus=1 then
    Label1.Caption:='AC power online'
  else Label1.Caption:='AC power offline';
end;
More for developers
Databases for Amazon Associates
Amazon Categories
Amazon Nodes