Retrieves an item.
long GetItem (
long tvItem,
GetItemFlag flag
) const;
Parameters
- tvItem
-
If flag is one of Next, Previous, Parent,
Child, NextListed or
PreviousListed, tvItem is the ID of a tree view item. Otherwise this parameter is ignored.
- flag
-
The return value of the function is determined by this GetItemFlag.
Return Value
The ID of the referenced tree view item (according to flag) or NoItem if there is
no such an item. RootItem is returned if flag is Parent and the
specified item has no parent, i.e. it is the root item.
Description
A tree item is considered as "listed (visible)" if its hierarchy level is expanded. However, an item can
be listed as visible even if it is currently not in the client rectangle of the tree view. To enumerate
all items on a hierarchy level use Next and Previous. To go through hierarchy levels use
Child and Parent. To enumerate all the listed items use NextListed and
PrevListed. To enumerate all items of a subtree write a recursive algorithm based on Child
and Next. The only way to determine whether an item is a parent is calling GetItem with
the Child flag. If the return value is different from NoItem the tree item has at least one
child.