Windows* WM_POWERBROADCAST code sample

Submit New Article

February 25, 2009 11:00 PM PST



Why Should I Care About This Code Sample?

As a supplement to the whitepaper, Windows* WM_POWERBROADCAST Messages in a Mobilized Environment, the following source code demonstrates the way an application would handle the WM_POWERBROADCAST message from the Windows operating system.  The application is a standard GUI application with a message pump.  The key area is the switch statement in WndProc() where the WM_POWERBROADCAST case is handled (i.e. line 171).

Target Audience
General interest, general application developer for mobile devices interested in handling power messages from Windows.

Sample Category
GUI-based application demonstrating the use of WM_POWERBROADCAST

Implementation Language
C

Target Hardware & Software Platforms

Hardware Systems: IA-32 platforms
Operating Systems: Microsoft Windows* 2000, and Windows* XP
Compilers: Microsoft Visual Studio* 6.0 and .Net