]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/tooltip.cpp
added several other accel strings
[wxWidgets.git] / src / msw / tooltip.cpp
index f805bf6e754e8a2760ec276df609ab32c2bfb61e..cbe06c171143c622a398148ad0ac3c274a58fe46 100644 (file)
 #include <commctrl.h>
 #endif
 
-HWND wxToolTip::hwndTT = NULL;
+// ----------------------------------------------------------------------------
+// global variables
+// ----------------------------------------------------------------------------
+
+// the tooltip parent window
+WXHWND wxToolTip::hwndTT = (WXHWND)NULL;
 
 // ----------------------------------------------------------------------------
 // private classes
@@ -51,7 +56,7 @@ public:
     wxToolInfo(wxWindow *win)
     {
         // initialize all members
-#ifdef __GNUWIN32__ && !defined(wxUSE_NORLANDER_HEADERS)
+#if __GNUWIN32__ && !defined(wxUSE_NORLANDER_HEADERS)
         memset(this, 0, sizeof(TOOLINFO));
 #else
         ::ZeroMemory(this, sizeof(TOOLINFO));
@@ -80,8 +85,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 +122,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;