title: Not receiving WM_QUERYENDSESSION when minimized to system tray
body: <p>I'm trying to catch WM_QUERYENDSESSION to save some data in the app, but it seems that I'm not receiving this message on User logoff/system restart when the app is minimized to the system tray. How can I catch it?</p>
  
  <p>Thanks.</p>
  
  <p>Relevant code (nothing magic in there, hopefully :)):</p>
  
  <pre><code>ON_WM_QUERYENDSESSION()
  
  BOOL CMainFrame::OnQueryEndSession()
  {
      AfxMessageBox(L"Are we hitting this?");
  
   return FALSE;
  }
  </code></pre>
  
  <p>For the tray icon I'm using a third-party lib (CodeJock), which I probably can't post here, but generally, it creates a hidden window to process messages, but the main window is simply ShowWindow(SW_HIDE) when needed. Maybe I need to intercept that message in that hidden window and pass it up, I'll need to try that.</p>