Search code examples
c#windows-cebattery

Check battery level in a Windows CE device


Possible Duplicate:
Getting battery information of a windows CE 5.0 device

I need to check the battery level in a Windows CE device using c#. I need something like the Win32_Battery class but for Mobile Devices.

Thanks for any help!


Solution

  • You can p/invoke the GetSystemPowerStatusEx API to get battery status, see http://msdn.microsoft.com/en-us/library/aa453172.aspx for the details.

    A quick google search also yields a samples:

    http://www.microsoft.com/en-us/download/details.aspx?id=11736

    and a tutorial:

    http://msdn.microsoft.com/en-us/library/aa446550.aspx