Export (0) Print
Expand All
Expand Minimize

CListCtrl::SetItemData

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

BOOL SetItemData(
   int nItem,
   DWORD_PTR dwData 
);

Parameters

nItem
Index of the list item whose data is to be set.
dwData
A 32-bit value to be associated with the item.

Return Value

Nonzero if successful; otherwise 0.

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;

// Set the data of each item to be equal to its index.
for (int i=0;i < pmyListCtrl->GetItemCount();i++)
{
   pmyListCtrl->SetItemData(i, i);
}

See Also

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

Show:
© 2014 Microsoft