Help with Tracking Tooltips
-
Hi, Hope someone can help me out here. I'm trying to add a tracking tooltip to my app, so I got the required code from the vS help files and then added it to my code. So basically I have:
HWND WINAPI CreateTT(HWND hwndOwner) { // Code for creating tool tip }
in my wndproc I addedcase WM_MOUSEMOVE: if(g_bIsVisible){ #define X_OFFSET 15 #define Y_OFFSET X_OFFSET GetCursorPos(&point); SendMessage(g_hwndTT, TTM_TRACKPOSITION, 0, (LPARAM)MAKELPARAM(point.x + X_OFFSET, point.y + Y_OFFSET)); } return 0;
I then added to my CASE WM_CREATE:g_hwndTT = CreateTT(hwnd);
When I compile my app I get a "Run-Time Check Failure #3 - The variable 'g_hwndTT' is being used without being defined." whenever I move the mouse. I don't understand why I get this error when I'm defining g_hwndTT using g_hwndTT = CreateTT(hwnd); I'm sure it is something simple I'm missing. Any help appreciated, Thanks in advance, Paddy.