This documentation is archived and is not being maintained.

CListCtrl::GetItemData

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

DWORD_PTR GetItemData(
   int nItem 
) const;

Parameters

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

Return Value

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

Remarks

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

Example

// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;

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

See Also

CListCtrl Overview | Class Members | Hierarchy Chart | CListCtrl::SetItemData

Show: