void CreateToolTip(HWND target, TCHAR* tooltip, LPARAM width) { HWND hwndToolTip; hwndToolTip = CreateWindow(TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, target, NULL, NULL, NULL); if (hwndToolTip) { TOOLINFO ti = {0}; ti.cbSize = sizeof(ti); ti.uFlags = TTF_TRANSPARENT | TTF_SUBCLASS; ti.hwnd = target; ti.uId = 0; ti.hinst = NULL; ti.lpszText = tooltip; GetClientRect(target, &ti.rect); SendMessage(hwndToolTip, TTM_ADDTOOL, 0, (LPARAM) &ti ); SendMessage(hwndToolTip, TTM_SETMAXTIPWIDTH, 0, width); SendMessage(hwndToolTip, TTM_SETDELAYTIME, TTDT_AUTOPOP, 20000); } }