]> git.saurik.com Git - wxWidgets.git/commitdiff
MSWProcessMessage speed up by a factor of 100 (at least)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 27 Feb 1999 14:39:34 +0000 (14:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 27 Feb 1999 14:39:34 +0000 (14:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1816 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/app.cpp

index 91d1c05287ec05e8cf8945ac2626e85b5e0cd579..9e1d6f64e44e497dec0b9fbc8ee4abce785d4500 100644 (file)
@@ -932,34 +932,27 @@ void wxApp::Dispatch()
  * the message. Some may have accelerator tables, or have
  * MDI complications.
  */
-bool wxApp::ProcessMessage(WXMSG *Msg)
+bool wxApp::ProcessMessage(WXMSG *wxmsg)
 {
-    MSG *msg = (MSG *)Msg;
-
-    HWND hWnd;
+    MSG *msg = (MSG *)wxmsg;
+    HWND hWnd = msg->hwnd;
+    wxWindow *wndThis = wxFindWinFromHandle((WXHWND)hWnd), *wnd;
 
     // Try translations first; find the youngest window with
     // a translation table.
-    for (hWnd = msg->hwnd; hWnd != (HWND) NULL; hWnd = ::GetParent(hWnd))
+    for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
     {
-        wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd);
-        if (wnd)
-        {
-            if (wnd->MSWTranslateMessage(Msg))
-                return TRUE;
-        }
+        if ( wnd->MSWTranslateMessage(wxmsg) )
+            return TRUE;
     }
 
     // Anyone for a non-translation message? Try youngest descendants first.
-    for (hWnd = msg->hwnd; hWnd != (HWND) NULL; hWnd = ::GetParent(hWnd))
+    for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
     {
-        wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd);
-        if (wnd)
-        {
-            if (wnd->MSWProcessMessage(Msg))
-                return TRUE;
-        }
+        if ( wnd->MSWProcessMessage(wxmsg) )
+            return TRUE;
     }
+
     return FALSE;
 }