Traverse and find items in external program Tree-view

Source: Internet
Author: User

"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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.