Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CListCtrl::GetItemData

 

Retrieves the 32-bit application-specific value associated with the item specified by nItem.


      DWORD_PTR GetItemData(
   int nItem 
) const;

nItem

Index of the list item whose data is to be retrieved.

A 32-bit application-specific value associated with the specified item.

This value is the lParam member of the LVITEM structure, as described in the Windows SDK

Example

// If any item's data is equal to zero then reset it to -1.
for (int i=0; i < m_myListCtrl.GetItemCount(); i++)
{
	if (m_myListCtrl.GetItemData(i) == 0)
	{
		m_myListCtrl.SetItemData(i, (DWORD) -1);
	}
}

Requirements

Header: afxcmn.h

Show: