title: WM_POWERBROADCAST message not caught in MFC Dlg
body: <p>I try to catch WM_POWERBROADCAST message when the system goes into sleep mode.</p>
  
  <p>I'm doing like :</p>
  
  <pre><code>BOOL CPowManApp::PreTranslateMessage(MSG* pMsg) 
  {
      if(pMsg-&gt;message == WM_POWERBROADCAST || pMsg-&gt;message == WM_POWER)
      {
          CString strMessage;
  
          strMessage.Format(_T("%d WM_POWERB%s wParam %x lParam %x"),
                           pMsg-&gt;time,
                           pMsg-&gt;message == WM_POWER?_T(""):_T("BRAODCAST"),
                           pMsg-&gt;wParam,
                           pMsg-&gt;lParam);
  
          OutputDebugString(strMessage);
      }
  
      return CWinApp::PreTranslateMessage(pMsg);
  }
  </code></pre>
  
  <p>It simply doesn't work. Meanwhile a win32 app works just fine. I tried to put the message handler in the Dlg class in vain.</p>
  
  <p>I'm building the app with VS6.0. Where am I wrong?</p>