Sign in to follow this  
Followers 0
kamyers1

ControlTreeView - GetText error

4 posts in this topic

Folks, I am cross-posting this from the AutoItX (COM control) forum (with a little more info). I have posted on that forum several times with no response, and am hoping to have better luck here, since more people apparently use this forum. Also, the ControlTreeView related stuff that I need to use should be almost identical between regular AutoIt and AutoItX...

I am attempting to use the ControlTreeView method GetText command on a tree view control (TreeView20WndClass) from a vbscript application under Windows XP. Here is the code that I used:

text=AutoIt.ControlTreeView("Output", "", "TreeView20WndClass3, "GetText", "#0","")

Using that command, text comes back blank, and AutoIt.error=1. However, text does appear on the nodes of this control, and I am able to successfully execute other ControlTreeView commands on this control, including Exists, GetItemCount, Collapse, and Expand.

The TreeView object in question exists on a tab control, and the relevant tab is active (displayed) when I am attempting to manipulate the TreeView. The owning application window is also active. I have tried enabling and giving focus to the TreeView control, but none of that seems to make any difference. I am able to send keystrokes to the TreeView, and can also select a node by index. However, selecting a node based on its text doesn't seem to work either.

This is AutoItX 3.3.0.0 under Windows XP SP3 with all critical updates applied.

Am I doing something wrong? Any suggestions?

Thanks,

Kevin M.

Share this post


Link to post
Share on other sites



Folks, I am cross-posting this from the AutoItX (COM control) forum (with a little more info). I have posted on that forum several times with no response, and am hoping to have better luck here, since more people apparently use this forum. Also, the ControlTreeView related stuff that I need to use should be almost identical between regular AutoIt and AutoItX...

I am attempting to use the ControlTreeView method GetText command on a tree view control (TreeView20WndClass) from a vbscript application under Windows XP. Here is the code that I used:

text=AutoIt.ControlTreeView("Output", "", "TreeView20WndClass3, "GetText", "#0","")

Using that command, text comes back blank, and AutoIt.error=1. However, text does appear on the nodes of this control, and I am able to successfully execute other ControlTreeView commands on this control, including Exists, GetItemCount, Collapse, and Expand.

The TreeView object in question exists on a tab control, and the relevant tab is active (displayed) when I am attempting to manipulate the TreeView. The owning application window is also active. I have tried enabling and giving focus to the TreeView control, but none of that seems to make any difference. I am able to send keystrokes to the TreeView, and can also select a node by index. However, selecting a node based on its text doesn't seem to work either.

This is AutoItX 3.3.0.0 under Windows XP SP3 with all critical updates applied.

Am I doing something wrong? Any suggestions?

Thanks,

Kevin M.

Are you sure that treeview was created by VBScript? Maybe it's actually and HTA (HTML Application)? If it is an .hta there is really an IE rendering engine presenting the page and you connect to it with _IEAttach() and work on the HTML DOM elements with the _IE* functions.

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Are you sure that treeview was created by VBScript? Maybe it's actually and HTA (HTML Application)? If it is an .hta there is really an IE rendering engine presenting the page and you connect to it with _IEAttach() and work on the HTML DOM elements with the _IE* functions.

:D

Although I have no access to the source code, I do know that the application I am attempting to control was written using VB 6 as a completely local, non-IE, non-HTML application. The treeview control in question is identified as a TreeView20WndClass object by AutoIt Windows Info. Besides, I'm not having any problems using other ControlTreeView commands on this control. It is only commands related to the text (GetText and Select by node text) that I am having a problem with.

P.S. - Maybe it wasn't obvious from my prior message, but it is MY controller application which uses the AutoItX COM object that is written using VBScript, not the application that I am attempting to control.

Thanks,

Kevin M.

Edited by kamyers1

Share this post


Link to post
Share on other sites

Although I have no access to the source code, I do know that the application I am attempting to control was written using VB 6 as a completely local, non-IE, non-HTML application. The treeview control in question is identified as a TreeView20WndClass object by AutoIt Windows Info. Besides, I'm not having any problems using other ControlTreeView commands on this control. It is only commands related to the text (GetText and Select by node text) that I am having a problem with.

P.S. - Maybe it wasn't obvious from my prior message, but it is MY controller application which uses the AutoItX COM object that is written using VBScript, not the application that I am attempting to control.

Thanks,

Kevin M.

Yeah, I had gotten the impression it was drawn by VBScript somehow. :D

What happens if you try it with the regular ControlTreeView() in regular AutoIt?

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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
Sign in to follow this  
Followers 0