Jump to content
Sign in to follow this  
tonglep

Use ControlGetText

Recommended Posts

tonglep

D disk folder App. I want to get the text in the Address box, then how?
These ways are not:
$ var = ControlGetText ("[CLASS: CabinetWClass]", "ComboBox", "ComboBox1")
$ text = WinGetText ("[CLASS: CabinetWClass]", "ComboBox1")
If getting text content then it is D: \ App
Thanks a lot

Share this post


Link to post
Share on other sites
tonglep

Address box of what?

of any window
eg when opening drive D, the title bar at the top, followed by the menu bar, standard toolbar, -> Address Bar

Thank you

Share this post


Link to post
Share on other sites
jvds

hum this?

$var = ControlGetText ("Local Disk (D:)", "", "[CLASS:ToolbarWindow32; INSTANCE:2]")
ConsoleWrite('!$var='&$var&@lf)

EDIT:
or these ones

$winarray = WinList()
for $x=1 to $winarray[0][0]

    $var = ControlGetText ($winarray[$x][1], "", "[CLASS:ToolbarWindow32; INSTANCE:2]")
    if $var then
        ConsoleWrite('windowname = '&$winarray[$x][0]&@CRLF)
        ConsoleWrite("[CLASS:ToolbarWindow32; INSTANCE:2] = "&$var&@CRLF&@CRLF)
    EndIf
Next
$winarray = WinList("[CLASS:CabinetWClass]")
for $x=1 to $winarray[0][0]
    $var = ControlGetText ($winarray[$x][1], "", "[CLASS:ToolbarWindow32; INSTANCE:2]")
    ConsoleWrite('windowname = '&$winarray[$x][0]&@CRLF)
    ConsoleWrite("adress = "&$var&@CRLF&@CRLF)
Next

 

Edited by jvds
edit
  • Like 1

Share this post


Link to post
Share on other sites
tonglep

hum this?

$var = ControlGetText ("Local Disk (D:)", "", "[CLASS:ToolbarWindow32; INSTANCE:2]")
ConsoleWrite('!$var='&$var&@lf)

EDIT:
or these ones

$winarray = WinList()
for $x=1 to $winarray[0][0]

    $var = ControlGetText ($winarray[$x][1], "", "[CLASS:ToolbarWindow32; INSTANCE:2]")
    if $var then
        ConsoleWrite('windowname = '&$winarray[$x][0]&@CRLF)
        ConsoleWrite("[CLASS:ToolbarWindow32; INSTANCE:2] = "&$var&@CRLF&@CRLF)
    EndIf
Next
$winarray = WinList("[CLASS:CabinetWClass]")
for $x=1 to $winarray[0][0]
    $var = ControlGetText ($winarray[$x][1], "", "[CLASS:ToolbarWindow32; INSTANCE:2]")
    ConsoleWrite('windowname = '&$winarray[$x][0]&@CRLF)
    ConsoleWrite("adress = "&$var&@CRLF&@CRLF)
Next

 

Thank you, you run the above code, obtained an unexpected result as follows: (of course, with the open disk D and folders)

>Running:(3.3.6.1):C:\Program Files\AutoIt3\autoit3.exe "D:\BTautoIT\ControlGetText\Controlgettext.au3"    
!$var=
windowname = 
[CLASS:ToolbarWindow32; INSTANCE:2] = Running Applications

windowname = ControlGetText
adress = 

+>14:58:15 AutoIT3.exe ended.rc:0
>Exit code: 0    Time: 2.605

 

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  

×