I need to write code in C that will indicate and notify me when the laptop battery power is low. I know that I can use the following:
BOOL WINAPI GetSystemPowerStatus(
__out LPSYSTEM_POWER_STATUS lpSystemPowerStatus
);
But I want to send a function to the operating system that will notify me when power is low.
I want to have an "empty" loop in my code, and when battery is low, the code will send me a notification (printf
or trace
).
I think I should be using kernel functions, but I can't find them