CListView SetInfoTip
-
I'm trying to set up info tips for different subitems in a CListView in Report mode. I can catch the LVN_GETINFOTIP when you hover over subitem 0, and correctly display the text I want. But hovering over any other subitem doesn't produce the notify. It would seem that the method CListView::SetInfoTip might do what I want, but it fails (returns false) when I invoke it, and I have no idea why. I have an application manifest, and I am using version 6 of ComClt32.dll. I've set the extended style to include LVS_EX_INFOTIP. I'd like to get this API working. Alternatively, if there's some way to get the LVN_GETINFOTIP notify when hovering over a different sub-item, that would do it too. thanks, Stache
-
I'm trying to set up info tips for different subitems in a CListView in Report mode. I can catch the LVN_GETINFOTIP when you hover over subitem 0, and correctly display the text I want. But hovering over any other subitem doesn't produce the notify. It would seem that the method CListView::SetInfoTip might do what I want, but it fails (returns false) when I invoke it, and I have no idea why. I have an application manifest, and I am using version 6 of ComClt32.dll. I've set the extended style to include LVS_EX_INFOTIP. I'd like to get this API working. Alternatively, if there's some way to get the LVN_GETINFOTIP notify when hovering over a different sub-item, that would do it too. thanks, Stache
The docs say that LVN_GETINFOTIP is only generated for the first item. As for SetInfoTip, make sure that you are using a wide string. I had the same problem only to find out later that I was passing a ANSI string when it expected a wide string. -Atul, Sky Software http://www.ssware.com Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
-
The docs say that LVN_GETINFOTIP is only generated for the first item. As for SetInfoTip, make sure that you are using a wide string. I had the same problem only to find out later that I was passing a ANSI string when it expected a wide string. -Atul, Sky Software http://www.ssware.com Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
Ok, I think I've done all the manifest stuff correctly. DLLGetVersion on "comctl32.dll" reports Major Version 6, Minor Version 0, Build 2900, Platform 2. Here's the actual code fragment, since at this point, I think I must be missing something blindingly obvious:
LVSETINFOTIP sit; sit.cbSize = sizeof( sit ); sit.dwFlags = 0; sit.iItem = 1; sit.iSubItem = 1; sit.pszText = L"fake primary info tip"; // This works, so we know item 1 is there. CString str = m_ListCtrl.GetItemText( 1, 1 ); // This always returns false, and no info tip appears. BOOL bResult = m_ListCtrl.SetInfoTip( & sit );
The extended style includes LVS_EX_INFOTIP and LVS_EX_LABELTIP, and I've tried either, both or none with no difference in results. Any insight would be greatly appreciated! thanks, Stache