]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/app.cpp
corrected use of Print Manager Session APIs for Carbon targets
[wxWidgets.git] / src / msw / app.cpp
index ed4d7367887739ba8cb9c71fb08307ef66151cdd..6277236d8e2e7fb87aee80d569c44acc24794286 100644 (file)
@@ -86,7 +86,7 @@
 #include <string.h>
 #include <ctype.h>
 
-#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
+#if defined(__WIN95__) && !((defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) && !defined(__CYGWIN10__))
     #include <commctrl.h>
 #endif
 
@@ -957,16 +957,21 @@ bool wxApp::DoMessage()
 #endif // wxUSE_THREADS
 
         // Process the message
-        if ( !ProcessMessage((WXMSG *)&s_currentMsg) )
-        {
-            ::TranslateMessage(&s_currentMsg);
-            ::DispatchMessage(&s_currentMsg);
-        }
+        DoMessage((WXMSG *)&s_currentMsg);
     }
 
     return TRUE;
 }
 
+void wxApp::DoMessage(WXMSG *pMsg)
+{
+    if ( !ProcessMessage(pMsg) )
+    {
+        ::TranslateMessage((MSG *)pMsg);
+        ::DispatchMessage((MSG *)pMsg);
+    }
+}
+
 /*
  * Keep trying to process messages until WM_QUIT
  * received.
@@ -1056,23 +1061,19 @@ bool wxApp::ProcessMessage(WXMSG *wxmsg)
     // a translation table.
     wxWindow *wnd;
 
+    bool pastTopLevelWindow = FALSE;
     for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
     {
-        if ( wnd->MSWTranslateMessage(wxmsg) )
+        if ( !pastTopLevelWindow && wnd->MSWTranslateMessage(wxmsg))
+            return TRUE;
+        if ( wnd->MSWProcessMessage(wxmsg) )
             return TRUE;
 
         // stop at first top level window, i.e. don't try to process the key
         // strokes originating in a dialog using the accelerators of the parent
         // frame - this doesn't make much sense
         if ( wnd->IsTopLevel() )
-            break;
-    }
-
-    // Anyone for a non-translation message? Try youngest descendants first.
-    for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
-    {
-        if ( wnd->MSWProcessMessage(wxmsg) )
-            return TRUE;
+            pastTopLevelWindow = TRUE;
     }
 
     return FALSE;