iSubItem
Value of type int that contains the one-based index of the subitem to which this structure refers.
It looks like you set 0-based index.
Main Topics
Browse All TopicsIm trying to add tool tips to my list-view. Here is my code:
LVSETINFOTIP info;
memset(&info,0,sizeof(info
info.cbSize = sizeof(info);
info.dwFlags = 0;
info.iItem = 0;
info.iSubItem = 0;
info.pszText = wbuffer;
if(!SendMessage(GetDlgItem
{
//ERROR: I get here
}
Why would SendMessage() return FALSE here?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi lwinkenb
The trick is to catch notification messages LVN_GETINFOTIP
Subclass the CListView, using a custom class (CMyListCtrl) derived from CListCtrl.
Within the derived class you will receive LVN_GETINFOTIP notification messages.
//## Header file MyListCtrl.h ##################
class CMyListCtrl : public CListCtrl
{
public:
CMyListCtrl () {;}
~CMyListCtrl (){;}
//{{AFX_MSG(CMyListCtrl)
afx_msg void OnLVNGetTipInfo(NMHDR* pNMHDR, LRESULT* pResult) ;
//}}AFX_MSG
[...]
DECLARE_MESSAGE_MAP()
};
//## Implmentation of MyListCtrl.h ##################
BEGIN_MESSAGE_MAP(CMyListC
//{{AFX_MSG_MAP(CMyListCtr
ON_NOTIFY_REFLECT(LVN_GETI
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//************************
//** some intiailzation prior to creation of ListView Control
//**
void CMyListCtrl::PreSubclassWi
{
CListCtrl::PreSubclassWind
//** Please send me LVN_GETINFOTIP messages
SetExtendedStyle( GetExtendedStyle() | LVS_EX_INFOTIP);
}
//************************
//** Message Handler for LVN_GETINFOTIP notifications
//**
void CMyListCtrl::OnLVNGetTipIn
{
//** we need a persistent buffer - very lazy programming
static CString strInfo;
if (pNMHDR->code != LVN_GETINFOTIP) return;
NMLVGETINFOTIP *lpGetInfoTip = (NMLVGETINFOTIP*)pNMHDR;
int iItem = lpGetInfoTip->iItem;
int iSubItem = lpGetInfoTip->iSubItem;
strInfo = "hello"; //** Display Info for 'iItem'
//* I believe no subitem info is ever available */
//** fill the NMLVGETINFOTIP structure
lpGetInfoTip->pszText = strInfo.GetBuffer(1);
lpGetInfoTip->cchTextMax = strInfo.GetLength();
}
Cheers,
Sebastian
Business Accounts
Answer for Membership
by: lwinkenbPosted on 2006-06-08 at 17:04:08ID: 16866526
Also, my manifest file looks like:
ft-com:asm .v1" manifestVersion="1.0"> " ame.YourAp plication" mmon-Contr ols" " ccf1df"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microso
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86
name="CompanyName.ProductN
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Co
version="6.0.0.0"
processorArchitecture="X86
publicKeyToken="6595b64144
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>