Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Call this function to set the 32-bit application-specific value associated with the specified item.
BOOL SetItemData(
HTREEITEM hItem,
DWORD_PTR dwData
);
Parameters
hItem
Handle of the item whose data is to be retrieved.dwData
A 32-bit application-specific value associated with the item specified by hItem.
Return Value
Nonzero if successful; otherwise 0.
Example
CString str;
HTREEITEM hItem;
// Insert 20 items into the tree control making every item's
// data be the handle of the item.
for (int i = 0; i < 20; i++)
{
str.Format(TEXT("item %d"), i);
hItem = m_TreeCtrl.InsertItem(str);
if (hItem != NULL)
{
m_TreeCtrl.SetItemData(hItem, (DWORD_PTR)hItem);
}
}
Requirements
Header: afxcmn.h