How to detect (from Delphi) when the laptop is running on batteries (or AC)?
There's a WINAPI function that I believe does this, GetSystemPowerStatus, which I believe you can execute from Delphi.