"PowerWord 2002" in the appendix collects a lot of ancient poems, sometimes in order to find an ancient poem, have to look for a long time (my liberal arts is very poor). Looking at the structure of its appendix, it was found to be a Tree-view control, and how good it would be if you could find the items inside.
To find the first traversal, even the range is not sure what to talk about search? So this article is divided into two parts to explain: the first part to solve the problem of traversal; the second part solves the problem of finding a specified item.
Part One: Traversing the items in the external program Tree-view
One: Program Description:
As shown in figure one, the typical structure diagram of the Tree-view control, we will iterate through the items in the order of the diagram.
Figure I
Looking through the relevant chapters of the SDK manual about the Tree-view control, I found several useful messages:
Tvm_getnextitem: Get the item handle (parameter: Tvgn_root get root handle, tvgn_nextvisible get the next visible item handle);
Tvm_expand: Expands or collapses the specified item (Parameters: Tve_expand expands the specified item);
Tvm_selectitem: Select the specified item.
Using these messages and the SendMessage () function, we can easily write the traversal code.