Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

ItemData

Defines an item's application-specific value.

C

SFTTREE_DWORD_PTR WINAPI SftTree_GetItemData(HWND hwndCtl, int index);
int WINAPI SftTree_SetItemData(HWND hwndCtl, int index, SFTTREE_DWORD_PTR dwd);
SFTTREE_DWORD_PTR WINAPI SftTreeSplit_GetItemData(HWND hwndCtl, int index);
int WINAPI SftTreeSplit_SetItemData(HWND hwndCtl, int index, SFTTREE_DWORD_PTR dwd);

C++

SFTTREE_DWORD_PTR CSftTree::GetItemData(int index) const;
LPVOID CSftTree::GetItemDataPtr(int index) const;
int CSftTree::SetItemData(int index, SFTTREE_DWORD_PTR dwd);
int CSftTree::SetItemDataPtr(int index, LPVOID ptr);
SFTTREE_DWORD_PTR CSftTreeSplit::GetItemData(int index) const;
LPVOID CSftTreeSplit::GetItemDataPtr(int index) const;
int CSftTreeSplit::SetItemData(int index, SFTTREE_DWORD_PTR dwd);
int CSftTreeSplit::SetItemDataPtr(int index, LPVOID ptr);

Parameters

hwndCtl

The window handle of the tree control.

index

The zero-based index of the item for which the application-defined value is to be retrieved or set.

dwd, ptr

The application-defined value to be associated with the specified item.

Returns

GetItemData(Ptr) returns the application-defined value specified for the item using SetItemData(Ptr) or -1 if an error occurred.

SetItemData(Ptr) returns 0 if the function was successful, otherwise -1 is returned.

Comments

The GetItemData and SetItemData functions define an item's application-specific value.

The application-defined value can be used by an application to associate additional information with an item, such as a pointer to a structure with application-specific data. The deletion callback can be used for cleanup processing when items are deleted (see SetDeleteCallback).

SetCellInfo can be used to define an application-specific value associated with a cell. SetControlData can be used to save an application-defined value associated with the tree control.

In a tree control using a virtual data source, SetItemData and SetItemDataPtr cannot be used and an error is returned. The dwdData member of the SFTTREE_ITEM structure is used instead.

See Also C/C++ API | Categories | Notifications