Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tree View Structure

You solved my problem with the Date Dialog earlier today so concisely that I am inspired to humbly impose on you for another request.

Same application uses a TreeView structure that I would like to traverse sequentially in QM. Thus far I've been using mouse moves with left clicks to do this, but this is a major pain in the rear, especially considering that the information in the tree can change at any time without notice, making my manually constructed mouse instructions worthless.

Can you demonstrate a method of traversing the treeview control, opening each parent, then selecting each child sequentially and retrieving the corresponding names for both parent and child?

This particular structure is nested only once, ie there is one level of parents with one level of children below each.

QM sees the control as TreeView20WndClass with style=0x56000027

Note: I did look up information on the TreeView control on the MS website, but at my level of experience I have no idea where to begin.

One method is to use tree view control messages. Other method - use accessible object function Navigate. Example with Windows Explorer:

Copy      Help
Acc a=acc("" "OUTLINE" "+ExploreWClass" "SysTreeView32" "" 0x1000) ;;captured with Find Accesible Object dialog
Acc a1
str s ss
a.Navigate("f" a1) ;;first item
,ss.set(9 0 val(ss))
,out "%s%s" ss s
,a1.Navigate("n"); err break
I used Find Accessible Object dialog which produced following line:

Acc a=acc("" "CLIENT" "Buy from Search" "TreeView20WndClass" "" 0x1000)

So my macro is:

Acc a=acc("" "CLIENT" "Buy from Search" "TreeView20WndClass" "" 0x1000)
Acc a1
str s ss
a.Navigate("f" a1) ;;first item
ss.set(9 0 val(ss))
out "%s%s" ss s
a1.Navigate("n"); err break

However, when I run the macro, it fails with "Error (RT) in TreeViewDirect: failed" with the cursor at the beginning of the a.Navigate line.
When you capture the object in Find Accessible Object dialog, look at the bottom, where is displayed hierarchy of accessible objects in that window. The object must be OUTLINE, not CLIENT. If you see OUTLINE somewhere near, select it. If no, then it is not standard tree view control, and you cannot enumerate it.
Under +WINDOW (TreeView20WndClass) "" there is only

No reference to OUTLINE anywhere.

You mentioned another method ... "use tree view control messages"? Any chance that might work? If so, where would you suggest I go to learn more about it? Thanks.
no chances
OK. Thanks much for trying.

Forum Jump:

Users browsing this thread: 1 Guest(s)