ouseLeave
   ' ===============================================
      
   ' ===============================================
   ' To effect the SetCapture/ReleaseCapture method:
   Case WM_MOUSEMOVE, WM_LBUTTONUP, WM_RBUTTONUP, WM_MBUTTONUP
      Dim tR As RECT, tP As POINTAPI
      GetClientRect m_hWnd, tR
      x = lParam And &amp;HFFFF&amp;
      y = lParam \ &amp;H10000
      tP.x = x
      tP.y = y
      ClientToScreen m_hWnd, tP
      If (PtInRect(tR, x, y) = 0) Or (WindowFromPoint(tP.x, tP.y) &lt;&gt; 