المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Tracking tooltip double-click problem when using XP manifest (ComCtl32.dl) [modified]



C++ Programming
08-29-2009, 02:01 AM
Hi,

I created a tracking tooltip (http://msdn.microsoft.com/en-us/library/bb760252%28VS.85%29.aspx#tooltip_sample_tracking) which works fine on Windows XP without a manifest, the tooltip is using TTF_TRACK and TTF_TRANSPARENT tooltip flags (http://msdn.microsoft.com/en-us/library/bb760256%28VS.85%29.aspx). When I add a manifest the left mouse click still works as expected (control behind tooltip receives WM_LBUTTONDOWN), but a double-click will not work (control behind the tooltip receives no WM_LBUTTONDBLCLK). Also the dialog loses focus when double-clicking over the tooltip, I am guessing that the tooltip gets the focus.

I needed some time to rule out any other cause for this problem, confirmed that nobody else is stealing messages, it's just triggered by using a manifest in order to get XP Visual styles (http://msdn.microsoft.com/en-us/library/ms997646.aspx)[^ (http://msdn.microsoft.com/en-us/library/ms997646.aspx)]. It looks like the tooltip implementation in ComCtl32.dll Version 6 is different and double-click mouse events are not forwarded to the parent ******** Anyone has an idea how to fix this problem? Thanks!

Here is my code to create the tooltip:

m_hTooltip = ::CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
m_hWnd, NULL, NULL, NULL);
if(m_hTooltip)
{
TOOLINFO ti;
memset(&ti, 0, sizeof(ti));
ti.cbSize = sizeof(ti);
ti.uFlags = TTF_TRACK | TTF_ABSOLUTE | TTF_TRANSPARENT | TTF_IDISHWND;
ti.hwnd = m_hWnd;
ti.uId = (UINT)m_hTooltip;
::SendMessage(m_hTooltip, TTM_ADDTOOL, 0, (LPARAM)&ti);
}

And then later to enable/disable the tooltip:

if(bEnable)
{
ti.lpszText = (LPTSTR)pText;
::SendMessage(m_hTooltip, TTM_UPDATETIPTEXT, 0, (LPARAM) &ti);
::SendMessage(m_hTooltip, TTM_TRACKPOSITION, 0, (LPARAM) MAKELONG(pRect->left, pRect->top));
::SendMessage(m_hTooltip, TTM_TRACKACTIVATE, TRUE, (LPARAM)&ti);
} else {
::SendMessage(m_hTooltip, TTM_TRACKACTIVATE, FALSE, (LPARAM)&ti);
}



My webchat in Europe (http://www.pichat.net/) http://www.barakasoft.com/script/Forums/Images/coffee.gif (in 4K (http://www.godx.de/en/C4_tiny_chat_software))