]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
Removed 'interface' pragma for gcc 2.96
[wxWidgets.git] / src / msw / window.cpp
index 6a4d9c2250771e3b42943a6006a80853596b84a1..e6d0d10345b81ea45c4d4a20275a8ab98e465762 100644 (file)
@@ -1897,7 +1897,8 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
 
         case WM_LBUTTONDOWN:
            // set focus to this window
-           SetFocus();
+           if (AcceptsFocus())
+                SetFocus();
 
            // fall through
 
@@ -4389,9 +4390,15 @@ static TEXTMETRIC wxGetTextMetrics(const wxWindow *win)
 // position.
 wxWindow* wxFindWindowAtPointer(wxPoint& pt)
 {
-    // Use current message to find last mouse position
-    extern MSG s_currentMsg;
-    HWND hWndHit = ::WindowFromPoint(s_currentMsg.pt);
+    return wxFindWindowAtPoint(wxGetMousePosition());
+}
+
+wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
+{
+    POINT pt2;
+    pt2.x = pt.x;
+    pt2.y = pt.y;
+    HWND hWndHit = ::WindowFromPoint(pt2);
 
     wxWindow* win = wxFindWinFromHandle((WXHWND) hWndHit) ;
     HWND hWnd = hWndHit;