LeTay
asked on
Check battery status in a Delphi application
Is there a way, in a Delphi application running on a portable PC, to check :
1. The battery charge status
2. If the PC is being charged with power cable
Thanks
1. The battery charge status
2. If the PC is being charged with power cable
Thanks
Define portable device. Every OS i.e. Windows, Android, IOS have api's that you can use.
ASKER
Hello, what do you mean ?
This is a PC, not a smartphone, so Windows 10
This is a PC, not a smartphone, so Windows 10
Here is the api for battery status
https://docs.microsoft.com/en-us/windows/desktop/power/battery-status-str
https://docs.microsoft.com/en-us/windows/desktop/power/battery-status-str
You can use WMI to get battery status. MS WMI Battery info record gives you all you need to know about battery.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.