LRESULT playlist_view::CreateToolTip(const char * text) { if (g_tooltip) {DestroyWindow(g_tooltip); g_tooltip=0;} DLLVERSIONINFO2 dvi; bool b_comctl_6 = SUCCEEDED(win32_helpers::get_comctl32_version(dvi)) && dvi.info1.dwMajorVersion >= 6; g_tooltip = CreateWindowEx(b_comctl_6?WS_EX_TRANSPARENT:0, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | TTS_NOPREFIX , CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, wnd_playlist, 0, core_api::get_my_instance(), NULL); // toolproc = (WNDPROC)uSetWindowLong(g_tooltip,GWL_WNDPROC,(LPARAM)(TooltipHook)); // uSendMessage(g_tooltip, CCM_SETVERSION, (WPARAM) COMCTL32_VERSION, 0); //SetWindowPos(g_tooltip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); RECT rect; GetClientRect (wnd_playlist, &rect); uTOOLINFO ti; memset(&ti,0,sizeof(ti)); ti.cbSize = sizeof(uTOOLINFO); ti.uFlags = TTF_TRANSPARENT|TTF_SUBCLASS;//TTF_SUBCLASS ti.hwnd = wnd_playlist; ti.hinst = core_api::get_my_instance(); ti.uId = ID_PLAYLIST_TOOLTIP; ti.lpszText = const_cast<char *>(text); ti.rect = rect; return uToolTip_AddTool(g_tooltip, &ti); }
void t_list_view::create_tooltip(/*t_size index, t_size column, */const char * str) { destroy_tooltip(); bool b_comctl_6 = true; m_wnd_tooltip = CreateWindowEx(b_comctl_6?WS_EX_TRANSPARENT:0, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | TTS_NOPREFIX , CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, get_wnd(), 0, core_api::get_my_instance(), NULL); SendMessage(m_wnd_tooltip, WM_SETFONT, (WPARAM)m_font.get(), MAKELPARAM(FALSE,0)); RECT rect; GetClientRect (get_wnd(), &rect); uTOOLINFO ti; memset(&ti,0,sizeof(ti)); ti.cbSize = sizeof(uTOOLINFO); ti.uFlags = TTF_TRANSPARENT|TTF_SUBCLASS; ti.hwnd = get_wnd(); ti.hinst = core_api::get_my_instance(); ti.uId = IDC_TOOLTIP; ti.lpszText = const_cast<char *>(str); ti.rect = rect; uToolTip_AddTool(m_wnd_tooltip, &ti); }