]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
fix from Robert for extra refreshes
[wxWidgets.git] / src / msw / window.cpp
index 2680a55bcdbd0eaa43f153fc3572b17ae8867da5..c7b28bac0bea9d4a1fb165304d704a82da873822 100644 (file)
@@ -4389,9 +4389,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;
@@ -4408,7 +4414,8 @@ wxWindow* wxFindWindowAtPointer(wxPoint& pt)
 // Get the current mouse position.
 wxPoint wxGetMousePosition()
 {
-    extern MSG s_currentMsg;
-    return wxPoint(s_currentMsg.pt.x, s_currentMsg.pt.y);
+    POINT pt;
+    GetCursorPos( & pt );
+    return wxPoint(pt.x, pt.y);
 }