Jump to content

Use ControlGetText


Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

 

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...