Jump to content

Can't get text items from ControlTreeView


jdegraff
 Share

Recommended Posts

I'm trying to add a bit of functionality to the FastStone File Rename dialog. I can access every control that I need to except the one that contains the files to be renamed. If I do some exploring in a vbScript shell I get

:c  = "TTntTreeView.UnicodeClass1"
:?aut.ControlTreeView(win,"",c,"GetItemCount","","")
5

You can see that the treeview control reports having five items, which is the number displayed. If I manually select (mouse) item #3 I can see the result by

:?aut.ControlTreeView(win,"",c,"GetSelected","1","")
#3

But I do not know how to get the text for the selected item. If "#3" is the item reference then I should be able to

:?aut.ControlTreeView(win,"",c,"GetText","1","#3")

or

:?aut.ControlTreeView(win,"",c,"GetText","1","#3")

if I go strictly by the help file, but it returns nothing.

:?aut.ControlTreeView(win,"",c,"Exists","","3")
1

So it appears that item 3 exists, but

:?aut.ControlTreeView(win,"",c,"GetText","","3")

does not have any text???

:?aut.ControlTreeView(win,"",c,"Exists","","9")
1

and it also appears item 9 exists (it does not)

:?aut.ControlTreeView(win,"",c,"Select","","")
1

causes the first item to be selected, as does

:?aut.ControlTreeView(win,"",c,"Select","","3")
1

Here is the output from the Window Info tool

>>>> Window <<<<
Title:  Batch Image Convert / Rename
Class:  TBatchConvert
Position:   501, 83
Size:   760, 520
Style:  0x16CD0000
ExStyle:    0x00010100
Handle: 0x0000000001950796

>>>> Control <<<<
Class:  TTntTreeView.UnicodeClass
Instance:   1
ClassnameNN:    TTntTreeView.UnicodeClass1
Name:   
Advanced (Class):   [CLASS:TTntTreeView.UnicodeClass; INSTANCE:1]
ID: 37030040
Text:   
Position:   354, 79
Size:   378, 188
ControlClick Coords:    108, 86
Style:  0x54010039
ExStyle:    0x00000200
Handle: 0x0000000002350898

>>>> Mouse <<<<
Position:   970, 279
Cursor ID:  0
Color:  0xE1E1E1

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Batch Rename
...
D:\temp\picsave\
Images + Videos (*.jpg;*.jpe;*.jpeg;*.bmp;*.gif;*.tif;*.tiff;*.cur;*.ico;*.png;*.pcx;*.jp2;*.j2k;*.tga;*.ppm;*.wmf;*.psd;*.crw;*.nef;*.cr2;*.orf;*.raf;*.dng;*.mrw;*.pef;*.srf;*.arw;*.rw2;*.x3f;*.sr2;*.srw;*.nrw;*.rwl;*.eps;*.avi;*.mpeg;*.mpg;*.wmv;*.mov;*.mp4;*.mts;*.mkv;*.m4v)
Search and Replace
Use Filename Template
No Sort
Clear
Remove
Add All
Add
Preview
Close
Rename
No Change
?
 

 

2018-03-03_135845.jpg

2018-03-03_135948.jpg

Edited by jdegraff
removed extraneous text
Link to comment
Share on other sites

Barring an explanation, can someone just provide me with the correct documentation for ControlTreeView. The example given in the documentation is

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
oAutoIt.ControlListView "C:\", "", "SysTreeView321", "SelectAll", "", ""
oAutoIt.ControlListView "C:\", "", "SysTreeView321", "Deselect", "2", "5"


which uses a ListView rather than a TreeView.
Link to comment
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
 Share

×
×
  • Create New...