

Enumerating the power modes that a Windows Professional device supports.Enumerating the hardware in a Windows Mobile Professional device.Changing the power state of hardware within the device.Displaying the voltage, current, and temperature of your device's battery.The example programs in the attached code illustrates the following: Since the APIs used are listed, the information should be useful to C++ developers as well. All of the sample code is in C#, with P/Invoke calls. I would normally wrap these calls in a helper, but have avoided using one for these examples so as to not add a layer of separation between the calls that I wish to demonstrate. Rather than declare P/Invokes in each individual program, there is a single project that contains all of the necessary native calls, and the example programs make their low level calls through the classes in that project. These programs rely on several native calls. The code examples included with this article are a collection of small programs that demonstrate one or two power management concepts. If the article becomes too large, then it may be broken into more than one article. However, at this point, I feel that the information presented can be helpful to a number of people, and I have decided to make the article available with the plans on evolving it over a period of time until it reaches a point at which I feel it is complete. Power management is a huge area to cover, and there is much I have to discuss and add to this article. While Windows Mobile Standard devices are mentioned within this document, it is centered around Windows Mobile Professional. In response to the voices of the community, I've collected information on Windows Mobile power management. Then, there are coding patterns that contribute to killing the battery much faster. Sometimes, a developer wants to reduce the demand on power, and at other times, disable the power saving features. As a regular reader of the MSDN support forums and other online development communities, I see several questions (some reoccurring) about the aspects of power management and control on Windows Mobile devices.
