WM_POWERBROADCAST handler for CMainDlg in ATL app not invoked

Posted by psychotik on Stack Overflow See other posts from Stack Overflow or by psychotik
Published on 2010-03-08T20:39:50Z Indexed on 2010/03/09 11:51 UTC
Read the original article Hit count: 438

Filed under:
|
|
|

I have an ATL app where I want to handle WM_POWERBROADCAST. I have a CMainDlg (CAxDialogImpl) in whose MSG_MAP I defined the handler.

BEGIN_MSG_MAP(CMainDlg)
    ...
    MESSAGE_HANDLER(WM_POWERBROADCAST, OnPowerChange)
    ...
END_MSG_MAP()

However, the handler isn't invoked when I do things that should invoke it, for instance change power settings or put the machine to sleep.

Any ideas about what might be going on, and how to fix this? Does CMainDlg not get notified of power events, for some reason?

© Stack Overflow or respective owner

Related posts about atl

Related posts about wtl