-/*
- * Give all windows a chance to preprocess
- * the message. Some may have accelerator tables, or have
- * MDI complications.
- */
-
-bool wxApp::ProcessMessage(WXMSG *wxmsg)
-{
- MSG *msg = (MSG *)wxmsg;
- HWND hWnd = msg->hwnd;
- wxWindow *wndThis = wxGetWindowFromHWND((WXHWND)hWnd);
-
- // this may happen if the event occured in a standard modeless dialog (the
- // only example of which I know of is the find/replace dialog) - then call
- // IsDialogMessage() to make TAB navigation in it work
- if ( !wndThis )
- {
- return ::IsDialogMessage(hWnd, msg) != 0;
- }
-
-#if wxUSE_TOOLTIPS
- // we must relay WM_MOUSEMOVE events to the tooltip ctrl if we want it to
- // popup the tooltip bubbles
- if ( (msg->message == WM_MOUSEMOVE) )
- {
- wxToolTip *tt = wndThis->GetToolTip();
- if ( tt )
- {
- tt->RelayEvent(wxmsg);
- }
- }
-#endif // wxUSE_TOOLTIPS
-
- // Try translations first; find the youngest window with
- // a translation table.
- wxWindow *wnd;
-
- bool pastTopLevelWindow = FALSE;
- for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )
- {
- 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() )
- pastTopLevelWindow = TRUE;
- }
-
- return FALSE;
-}