X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/066f302c6c9e8628b2cea3a3f89f5d18f6b4cfc8..7b9da2077d0975db6c965a85c91d5aca671ab5e3:/src/msw/tooltip.cpp diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index f805bf6e75..ebf490177d 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -36,33 +36,37 @@ #include #endif -HWND wxToolTip::hwndTT = NULL; +// ---------------------------------------------------------------------------- +// global variables +// ---------------------------------------------------------------------------- + +// the tooltip parent window +WXHWND wxToolTip::hwndTT = (WXHWND)NULL; // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- - // a simple wrapper around TOOLINFO Win32 structure -#pragma warning( disable : 4097 ) +#ifdef __VISUALC__ + #pragma warning( disable : 4097 ) // we inherit from a typedef - so what? +#endif class wxToolInfo : public TOOLINFO { public: wxToolInfo(wxWindow *win) { // initialize all members -#ifdef __GNUWIN32__ && !defined(wxUSE_NORLANDER_HEADERS) - memset(this, 0, sizeof(TOOLINFO)); -#else ::ZeroMemory(this, sizeof(TOOLINFO)); -#endif cbSize = sizeof(TOOLINFO); uFlags = TTF_IDISHWND; uId = (UINT)win->GetHWND(); } }; -#pragma warning( default : 4097 ) +#ifdef __VISUALC__ + #pragma warning( default : 4097 ) +#endif // ---------------------------------------------------------------------------- // private functions @@ -80,8 +84,8 @@ inline LRESULT SendTooltipMessage(WXHWND hwnd, // send a message to all existing tooltip controls static void SendTooltipMessageToAll(WXHWND hwnd, - UINT msg, - WPARAM wParam, + UINT msg, + WPARAM wParam, LPARAM lParam) { if ( hwnd ) @@ -117,13 +121,20 @@ WXHWND wxToolTip::GetToolTipCtrl() { if ( !hwndTT ) { - hwndTT = ::CreateWindow(TOOLTIPS_CLASS, + hwndTT = (WXHWND)::CreateWindow(TOOLTIPS_CLASS, (LPSTR)NULL, TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, (HMENU)NULL, - wxGetInstance(), NULL); + wxGetInstance(), + NULL); + if ( hwndTT ) + { + SetWindowPos((HWND)hwndTT, HWND_TOPMOST, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + } + } return (WXHWND)hwndTT;