+LRESULT APIENTRY wxToolTipWndProc(HWND hwndTT,
+ UINT msg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ if ( msg == TTM_WINDOWFROMPOINT )
+ {
+ LPPOINT ppt = (LPPOINT)lParam;
+ // is the window under control a wxWindow?
+ HWND hwnd = ::WindowFromPoint(*ppt);
+
+ // return a HWND correspondign to wxWindow because only wxWindows are
+ // associated with tooltips using TTM_ADDTOOL
+ while ( hwnd && !wxFindWinFromHandle((WXHWND)hwnd) )
+ {
+ hwnd = ::GetParent(hwnd);
+ }
+
+ if ( hwnd )
+ {
+ // modify the point too!
+ RECT rect;
+ GetWindowRect(hwnd, &rect);
+
+ ppt->x = rect.left;
+ ppt->y = rect.top;
+
+ return (LRESULT)hwnd;
+ }
+ }
+
+ return ::CallWindowProc(gs_wndprocToolTip, hwndTT, msg, wParam, lParam);
+}