Jump to content

Can't get text items from ControlTreeView

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"

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


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




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


So it appears that item 3 exists, but


does not have any text???


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


causes the first item to be selected, as does


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
Advanced (Class):   [CLASS:TTntTreeView.UnicodeClass; INSTANCE:1]
ID: 37030040
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
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
Add All
No Change




Edited by jdegraff
removed extraneous text

Share this post

Link to post
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.

Share this post

Link to post
Share on other sites

the image you posted is not a standard ControlTreeView

help states



Sends a command to a TreeView32 control.


Edited by Earthshine

Share this post

Link to post
Share on other sites

that is a Delphi control. Standard AutoIt probably will not work. junkew had some stuff that dealt with Delphi I think... search the form for Delphi control I guess

Share this post

Link to post
Share on other sites

I found this. it might help if it still works.. fingers crossed


Share this post

Link to post
Share on other sites

Well, that explains a lot. I had no idea that it was a custom control. I think I have a workaround for what I want to do. It's not pretty but it will get the job done. Thanks.

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

  • Similar Content

    • vyperhand
      By vyperhand
      I'm struggling to launch a VBS file via autoit using RunWait.  Due to the nature of the deployment tool I am using for said script, I only know that the .vbs files will be in the same directory as my AutoIt-generated .exe, but not what that path will be.  The path will look something like this:
      This is generated during deployment and I have no way of predicting the path - therefore, I am not sure how to call back to "same directory" in order to successfully launch the .vbs.
      This line is as close as I have gotten - this fires off the cmd window, but it closes immediately with out information, and the .vbs is not launched.
      RunWait (@ComSpec & " /c" & 'cscript.exe WORKPLEASE.vbs ALL /Q /NoCancel') I thought /c might be the problem, but leaving out the /c element causes me not to even see the momentary CMD window flash by.  Any help will be greatly appreciated, and thanks in advance.
    • ur
      By ur
      I am trying to identify the window based on the window title and text.
      The title will be the "erwin DM - filename"

      It is working till date, but some operating systems our application is displaying window as "erwin DM - [filename]"
      I tried  "erwin DM - *filename*" But this regular expression is not working.
      Any suggestion?
      $sModelFile = "C:\Users\Administrator\Documents\My Models\eMovies.erwin" $wdModel = _WinWaitActivate1("erwin DM - "&FileNameOnly($sModelFile),"") Func _WinWaitActivate1($title,$text,$timeout=0);Will Return the window Handler Logging("Waiting for "&$title&":"&$text) $dHandle = WinWait($title,$text,$timeout) if not ($dHandle = 0) then If Not WinActive($title,$text) Then WinActivate($title,$text) return WinWaitActive($title,$text,$timeout) Else Logging("Timeout occured while waiting for the window...") Exit EndIf EndFunc Func FileNameOnly($sFilePath) Local $sDrive = "", $sDir = "", $sFileName = "", $sExtension = "" Local $aPathSplit = _PathSplit($sFilePath, $sDrive, $sDir, $sFileName, $sExtension) ;_ArrayDisplay($aPathSplit, "_PathSplit of " & @ScriptFullPath) return $sFileName EndFunc  
    • natedog102
      By natedog102
      This small UDF helps you save any text to speech to a .wav file. 
      #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #include-once ; #INDEX# ======================================================================================================================= ; Title .........: _TTStoWav() ; AutoIt Version : ; Language ......: English ; Author(s) .....: natedog102 ; Modifiers .....: ; Forum link ....: https://www.autoitscript.com/forum/topic/191573-tts-text-to-speech-to-wav-file-using-sapi/ ; Description ...: TTS to .wav file using SAPI ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: _TTStoWav ; Description ...: TTS to .wav file using SAPI ; Syntax.........: _TTStoWav($sText, $sLocation[, $iRate = 1[, $iVolume = 100]]) ; Parameters ....: $sText - String you want converted to a .wav ; $sLocation - Save location + file name, example: "C:\folder\sample.wav" ; $iRate - TTS speak rate between -10 and 10 ; $iVolume - Volume of the TTS between 0 and 100 ; Return values .: Success - Returns one ; Failure - Returns zero ; Author ........: natedog102 ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TTStoWav($sText, $sLocation, $iRate = 1, $iVolume = 100) $oFileStream = ObjCreate("SAPI.SpFileStream") If @error Then Return 0 EndIf $oFileStream.Format.Type = 39 $oFileStream.Open($sLocation, 3) $oSpeech = ObjCreate('SAPI.SpVoice') If @error Then Return 0 EndIf $oSpeech.AudioOutputStream = $oFileStream $oSpeech.Rate = $iRate $oSpeech.Volume = $iVolume $oSpeech.Speak($sText, 3) $oSpeech.WaitUntilDone(10000) $oFileStream.Close() Return 1 EndFunc ;==>_TTStoWav And here's example usage:
      _TTStoWav("This is a test", "C:\folder-must-exist\sample2.wav") I have never made a UDF before so I don't know if I coded it correctly or if I followed all the recommended guidelines. Apologies if I haven't.
    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Guys this is my gui and i need the numeric value typed in the highlighted  inputbox. if this value is greater than 1 i need to perform some operations
      Here is the summary about that field which i got from wininfo tool

      i tried writing the code as shown below.. but the msgbox is popping up empty value..when the same code is pasted under some button action i am able to access the value present in the field..but when placed alone as written in the attached script i am unable to fetch it... 

      here i am using the valu present in the field

      can you guys tell me what's wrong??? or how can i get that value?

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi

      in need the path/text present int above shown input box to be copied or retrieved into a variable .. how can i do that?

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.