Windows Mobile Devices and Power States

I’ve been doing some Windows Mobile development with the .NET Compact Framework recently and ran into a scenario where I needed the device to be in “full power” mode at all times with the back-light on.  The device is constantly powered, so battery life is not a concern.

The obvious choice is to go into the Brightness and Power control panels and turn off the appropriate settings, but I learned that there is a way to handle this at an application level so the behavior only occurs while the application is running.

Power State

An application can force a specific power state using the SetPowerRequirement method, and release that state using the ReleasePowerRequirement method.  Using P/Invoke, these methods look like the following:

   1: public enum CEDevicePowerState
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; …
Read More