I'm trying to write a program that when used on a laptop will be able to detect a change from AC to battery power by catching the WM_POWERBROADCAST message. Using Spy++, I see the message being sent to my application. In an overwrite of PreTranslateMessage, I am looking for WM_POWERBROADCAST and trying to display a message indicating the message has been caught. However, this has yet to work.
What am I missing in order to catch this message -- does it have to be caught before PreTranslateMessage or what?
I'm using VC++ 5.0 under Win 95.