Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

ItemID

Defines an item's ID.

C

SFTTREE_ID WINAPI SftTree_GetItemID(HWND hwndCtl, int index);
void WINAPI SftTree_SetItemID(HWND hwndCtl, int index, SFTTREE_ID ID);
SFTTREE_ID WINAPI SftTreeSplit_GetItemID(HWND hwndCtl, int index);
void WINAPI SftTreeSplit_SetItemID(HWND hwndCtl, int index, SFTTREE_ID ID);

C++

SFTTREE_ID CSftTree::GetItemID(int index) const;
void CSftTree::SetItemID(int index, SFTTREE_ID ID);
SFTTREE_ID CSftTreeSplit::GetItemID(int index) const;
void CSftTreeSplit::SetItemID(int index, SFTTREE_ID ID);

Parameters

hwndCtl

The window handle of the tree control.

index

The zero-based index of an item for which the item ID is to be retrieved or set.

ID

The item's item ID.

Returns

GetItemID returns the item's item ID.

SetItemID returns TRUE if the function was successful, otherwise FALSE is returned.

Comments

The GetItemID and SetItemID functions define an item's ID.

When an item is added to the tree control, it is automatically assigned a unique ID, which does not change throughout the lifetime of an item. Even if an item changes its index position because other items are deleted or inserted, the item ID remains constant.

An application can change an item's item ID using the SetItemID function. In this case, if a unique item ID is required, the application must insure using its own mechanisms that unique IDs are used.

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

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