views:

1197

answers:

1

Hello,

I'm trying to write a small app that monitors how much power is left in a notebook battery and I'd like to know which Win32 function I could use to accomplish that.

+4  A: 

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.

Brian R. Bondy