title: Is it possible to capture the window messages/events inside the Translate/Dispatch Message loop
body: <p>Is it possible to capture the window <code>messages/events</code> inside the <code>Translate/Dispatch Message loop</code>?</p>
  
  <p>this is the Message process method for the window </p>
  
  <pre><code>LRESULT CALLBACK MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
  {
      switch (msg)
      {
      case WM_DESTROY:
          PostQuitMessage(0);
          break;
      case WM_KEYDOWN:
          PressedKey[wParam] = true;
          break;
      case WM_KEYUP:
          PressedKey[wParam] = false;
          break;
      case WM_SIZE:
  
          break;
      default:
          break;
      }
  
      return DefWindowProc(hwnd, msg, wParam, lParam);
  }
  </code></pre>
  
  <p>and here is <code>Translate/Dispatch Message loop</code></p>
  
  <pre><code>void MyScreen::RunScreenMainLoop()
  {
      while (WM_QUIT != msg.message)
      {
          //I wanna handle the messages here as well!
          switch (msg.message)
          {
          case WM_SIZE:
              show("size event called");
              break;
          default:
              break;
          }
          if (PeekMessage(&amp;msg, NULL, NULL, NULL, PM_REMOVE))
          {
              TranslateMessage(&amp;msg);
              DispatchMessage(&amp;msg);
          }
          else
          {
              //do other stuff
          }
      }
  }
  </code></pre>
  
  <p>but it never goes inside the switch statement , is there a work a round to do this?</p>