How to detect when the laptop is running on batteries?

前端 未结 3 811
萌比男神i
萌比男神i 2021-02-08 07:27

How to detect (from Delphi) when the laptop is running on batteries (or AC)?

3条回答
  •  执念已碎
    2021-02-08 07:33

    There's a WINAPI function that I believe does this, GetSystemPowerStatus, which I believe you can execute from Delphi.

提交回复
热议问题