Tooltip only shown sometimes?!
Hello,
I implemented a simple tooltip for my deskband which is only shown
sometimes. for example after activating the deskband and hover over the
band, the tootip is shown. it is not shown, when the time of the tooltip
is eleapsed (smoothed out) and i hover the cursor again over the band.
it is also not shown when i click on the desktop and then hover the
cursor over the band.
...sounds difficult?! :-) to understand what i mean, have a look at the
tooltips of the tray icons. they are shown always.
has anyone an idea what's happening here? i looked at the msdn lib, used
google, but all without success.
thanks for any tips and advices!
//////////////////////////////////////////////////////////////////////
m_hWndToolInfo = CreateWindowEx(
WS_EX_TOOLWINDOW,
TOOLTIPS_CLASS,
NULL,
WS_POPUP | TTS_NOPREFIX,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
m_hWnd, // Window Handle of Deskband
NULL,
g_hInst, // Instance of Deskband
NULL);
if (m_hWndToolInfo)
{
SetWindowPos(m_hWndToolInfo,
HWND_TOPMOST,
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
char strTT[400] = "Some Text";
LPTSTR lptstr = strTT;
// Initialize Members of the Toolinfo Structure
m_ti.cbSize = sizeof(TOOLINFO);
m_ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
m_ti.hwnd = m_hWnd;
m_ti.hinst = g_hInst;
m_ti.uId = (UINT)m_hWnd;
m_ti.lpszText = strTT;
// Send an TTM_ADDTOOL to the Tooltip Control
SendMessage(m_hWndToolInfo, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &m_ti);
SendMessage(m_hWndToolInfo, TTM_ACTIVATE, true, 0);
}
//////////////////////////////////////////////////////////////////////