Jump to content

TreeView + GetText: only number of items is found

Recommended Posts



I am new to AutoIt and am trying my best to improve my skills and also one day hope to return some support to others here.

I am currently struggling with an external application that I need to control.


So far, I have been able to do some very basic stuff, e.g. launch it, wait for its main window to show up, select a menu item and click it, wait for another window to show up.

This second window contains a large treeview control. It has many collapsed items with many sub-items, also collapsed, and then many entries. I was able to identify the control to get its window handle, class name, ID and I was also able to get the correct amount of items and sub-items.


The point where I am stuck now is to search for a particular item, click on that item to both select it and return from the treeview window to the main window. Unfortunately, I cannot post an image of the treeview here because I use it at work and atm I am using my private Linux computer on which i cannot use autoit anyway.


I am stuck because I do not get any string results, either I get 0 or no entry at all.


As I am really quite new I might already be stuck deciding what function I should use to get the text items. Am I right to say that there are _GUI functions that are supposed to work only with autoit-built GUIs, or would all functions provided by autoit work both for internal and external GUIs? How about the admin-issue - would this cure my issue, if I ran autoit as admin (not sure why I get correct results for the number of items though)?

Perhaps you can point me to a neat and fool-proof tutorial on how to setup autoit to properly find text in a treeview.


Thanks a lot for your help in advance! It is highly appreciated.


Share this post

Link to post
Share on other sites

What application, exactly, are you trying to automate this tree control?  If you were trying to automate windows explorer been good luck. It is extremely unwieldy 

My resources are limited. You must ask the right questions


Share this post

Link to post
Share on other sites

These are the details I get from autoit:

>>>> Window <<<<

Title:      Testcases

Class:    WindowsForms10.Window.8.app.0.141b42a_r14_ad1

Position:              2888, 166

Size:      553, 636

Style:    0x16CF0000

ExStyle: 0x00050100

Handle: 0x0000000000560A88


>>>> Control <<<<

Class:    WindowsForms10.SysTreeView32.app.0.141b42a_r14_ad1

Instance:             1

ClassnameNN:  WindowsForms10.SysTreeView32.app.0.141b42a_r14_ad11

Name:  treOverview

Advanced (Class):            [NAME:treOverview]

ID:          527098


Position:              7, 48

Size:      525, 543

ControlClick Coords:       265, 247

Style:    0x56310207

ExStyle: 0x00000000

Handle: 0x0000000000080AFA


>>>> Mouse <<<<

Position:              3168, 492

Cursor ID:           0

Color:    0x3A0000


>>>> StatusBar <<<<


>>>> ToolsBar <<<<


>>>> Visible Text <<<<





I am sorry I cannot post the original application window content due to restrictions of my company. It is no standard Windows application (no Explorer, no Excel, no part of Office). It is a non-AutoIt application (i.e. no AutoIt elements were used to create the window and the treeview list).

Would it be required to unfold all collapsed parts before searching for a particular string? But atm. I do not even get a single string.

Share this post

Link to post
Share on other sites

Well can you post your code that isn’t working minus anything sensitive 

My resources are limited. You must ask the right questions


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.