Monitor battery charge with Win32 API
For Vista and up you can use RegisterPowerSettingNotification
For earlier functions see the Power Management Functions in this section of the MSDN page "Power Management Functions: Windows Server 2003 and Earlier"
You can see example code of the Vista method on codeproject.
I recommend the use of the Win32 GetSystemPowerStatus function. A code snippet :
int getBatteryLevel()
{
SYSTEM_POWER_STATUS status;
GetSystemPowerStatus(&status);
return status.BatteryLifePercent;
}