X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b12915c104de03c9fd5102404e35051e9b8609a8..438e3558adf77a68f56b6e4d30b359f8361facac:/src/msw/app.cpp diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 5f32a13e20..1be88f6a6e 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -67,6 +67,10 @@ #include "wx/resource.h" #endif +#if wxUSE_TOOLTIPS + #include "wx/tooltip.h" +#endif // wxUSE_TOOLTIPS + // OLE is used for drag-and-drop, clipboard, OLE Automation... #ifndef wxUSE_NORLANDER_HEADERS #if defined(__GNUWIN32__) || defined(__SC__) || defined(__SALFORDC__) @@ -959,19 +963,24 @@ bool wxApp::ProcessMessage(WXMSG *wxmsg) { MSG *msg = (MSG *)wxmsg; HWND hWnd = msg->hwnd; - wxWindow *wndThis = wxFindWinFromHandle((WXHWND)hWnd), *wnd; + wxWindow *wndThis = wxGetWindowFromHWND((WXHWND)hWnd); - // for some composite controls (like a combobox), wndThis might be NULL - // because the subcontrol is not a wxWindow, but only the control itself - // is - try to catch this case - while ( hWnd && !wndThis ) +#if wxUSE_TOOLTIPS + // we must relay WM_MOUSEMOVE events to the tooltip ctrl if we want it to + // popup the tooltip bubbles + if ( wndThis && (msg->message == WM_MOUSEMOVE) ) { - hWnd = ::GetParent(hWnd); - wndThis = wxFindWinFromHandle((WXHWND)hWnd); + 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; for ( wnd = wndThis; wnd; wnd = wnd->GetParent() ) { if ( wnd->MSWTranslateMessage(wxmsg) ) @@ -1152,7 +1161,11 @@ int wxApp::GetComCtl32Version() FARPROC theProc = ::GetProcAddress ( hModuleComCtl32, +#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x520) + "InitCommonControlsEx" +#else _T("InitCommonControlsEx") +#endif ); if ( !theProc ) @@ -1167,7 +1180,11 @@ int wxApp::GetComCtl32Version() theProc = ::GetProcAddress ( hModuleComCtl32, +#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x520) + "InitializeFlatSB" +#else _T("InitializeFlatSB") +#endif ); if ( !theProc ) { @@ -1262,6 +1279,6 @@ wxApp::GetStdIcon(int which) const // For some reason, with MSVC++ 1.5, WinMain isn't linked in properly // if in a separate file. So include it here to ensure it's linked. -#if (defined(__VISUALC__) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !defined(__TWIN32__)) +#if (defined(__VISUALC__) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !defined(__TWIN32__) && !defined(WXMAKINGDLL)) #include "main.cpp" #endif