win32/desktop-src/Power/battery-information.md at docs
After completing these steps, the application can send queries to each battery device. Because each battery device represents a slot into which a battery can be inserted, there must be a
To successfully complete the query, a new battery tag is required. Acquire the tag using the IOCTL_BATTERY_QUERY_TAG operation. If a battery is present in that slot, the tag returned can be passed to any of the other battery IOCTLs to perform other functions.
To obtain information about the battery status, use the GetSystemPowerStatus function, which returns general information about all power sources in the system. You should use GetSystemPowerStatus whenever possible. In some cases, however, detailed information about each individual battery is necessary.
Retrieves a variety of information for the battery. To perform this operation, call the DeviceIoControl function with the following parameters. (HANDLE) hDevice, // handle to battery IOCTL_BATTERY_QUERY_INFORMATION, // dwIoControlCode (LPVOID) lpInBuffer, // input buffer
On Battery: When on battery, it will also display the Estimated Run Time. I'm pulling the battery information from several WMI Classes and two name spaces. From this Class, I'm using EstimatedChargeRemaining, which is a % & EstimatedRunTime, which is in Minutes. I then head over to RootWMI and look at the Battery Classes there:
PDF version includes complete article with source references.
Get specifications and technical data for our MW-scale energy storage and PV integration solutions.
45 Energy Innovation Park
London WC2H 8NA, United Kingdom
+44 20 7783 1966
Monday - Friday: 8:00 AM - 6:00 PM GMT