title: WM_LBUTTONDOWN & WM_LBUTTONUP not received
body: <p>I created toplevel window, but for unknown reasons my WNDPROC does not receive <strong>WM_LBUTTONDOWN/WM_LBUTTONUP</strong> nor <strong>WM_MOUSEMOVE</strong> messages.</p>
  
  <p>Any suggestions?</p>
  
  <p>Relevant code:</p>
  
  <pre><code>WNDCLASSEX wc = {0};
  Wc.cbSize = 48;
  Wc.cbWndExtra = 80;
  Wc.hCursor = LoadCursorW(g_hInstance, MAKEINTRESOURCEW(1002));
  Wc.style = CS_GLOBALCLASS | CS_DBLCLKS;
  Wc.lpszClassName = Ici[dItemIndex].sInit;
  Wc.lpfnWndProc = Ici[dItemIndex].wInit;
  
  RegisterClassExW(&amp;Wc);
  
  g_hRuler1 = CreateWindowExW(WS_EX_TOOLWINDOW,
                              RULER_CONTROL,
                              L"",
                              WS_POPUP|WS_VISIBLE|0x1,
                              100 ,100, 40, RECTHEIGHT(g_rScreen),
                              NULL, NULL, hInst, NULL);
  
  LRESULT WINAPI Ruler_Window(HWND hWindow, UINT uWindow, WPARAM wParam, LPARAM lParam)
  {
      if (uWindow == WM_GETMINMAXINFO)
      {
          goto DODEFAULT;
      }
  
      if (uWindow == WM_NCCREATE)
      {
          g_pGRI = RULER_ALLOCATE();
  
          RULER_SET_POINTER(hWindow, (LONG_PTR)g_pGRI);
  
          return 1L;
      }
  
      g_pGRI = RULER_GET_POINTER(hWindow);
  
      g_pGRI-&gt;hWindow = hWindow;
  
      switch(uWindow)
      {
      case WM_CREATE:
          {
              return Ruler_OnCreate(wParam, lParam);
          }
  
      case WM_PAINT:
          {
              return Ruler_OnPaint(wParam, lParam);
          }
  
      case WM_MOUSEMOVE:
          {
              return Ruler_OnMouseMove(wParam, lParam);
          }
  
      case WM_DESTROY:
          {
              return Ruler_OnDestroy(wParam, lParam);
          }
  
      case WM_SETCURSOR:
          {
              return Ruler_OnSetCursor(wParam, lParam);
          }
  
      case WM_LBUTTONDOWN:
          {
              return Ruler_OnLeftButtonDown(wParam, lParam);
          }
  
      case WM_LBUTTONUP:
          {
              return Ruler_OnLeftButtonUp(wParam, lParam);
          }
  
      case GM_SETINDICATORS:
          {
              return Ruler_OnSetIndicators(wParam, lParam);
          }
  
  DODEFAULT:
      return DefWindowProcW(hWindow, uWindow, wParam, lParam);
      }
  
  }
  </code></pre>
  
  <p>Spy++ messages of window after left button click.</p>
  
  <p><img src="https://i.stack.imgur.com/W6YkU.png" alt="enter image description here"></p>