Reputation: 75
Is it possible to write in C to get the alert. If yes, what is the concept to be applied to get an alert when my battery goes down by 40% or gets high to 80%?
Upvotes: 1
Views: 153
Reputation: 798
You have to use Windows API to get the battery information. Please refer to the link: https://msdn.microsoft.com/en-us/library/windows/desktop/aa372659(v=vs.85).aspx
The following ioctls are used to get the battery information
IOCTL_BATTERY_QUERY_INFORMATION
IOCTL_BATTERY_QUERY_STATUS
IOCTL_BATTERY_QUERY_TAG
IOCTL_BATTERY_SET_INFORMATION
GetSystemPowerStatus
function is used to get the power status in windows. Refer to the link: https://msdn.microsoft.com/en-us/library/windows/desktop/aa372693(v=vs.85).aspx
Upvotes: 1