Sign in to follow this  
Followers 0
Shevilie

Get Control IDs from an app

7 posts in this topic

Well the problem is that I often use Autoit Window Info tool - And it work like a charm.. The problem is that some windows are build so all buttons are "visible" to the program but not the human eye (they are under a different tab or menu) and that makes it very diffecult to get the right id (have to take the mouse nearly pixel by pixel until the right text is in the text (in auto tool) and the hit alt + f to freeze - well this is very bugger... And I would like to do something like

While (something)

$text = ControlGetText("Appname", "", $control)

ConsoleWrite("Control: " & $controlname & " Contain: " $text)

WEnd

Or simply get a list of all ControlIDs in a program (or a list of all ClassNameNN)


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites



Hmm WinGetClassList looks a little what I'm looking for


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hmm WinGetClassList looks a little what I'm looking for

That (WinGetClassList) won't return what you are trying to get, just use the actual function itself, and you will get all the information. When I said I was using a custom function the other day to give me all the information of that java applet, it was a modded version of that. Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Nice.. (Well the other gave a little after i modded it to)

$t = WinGetClassList("name")
$i = 0
While StringLen($t) > 0
;~  MsgBox(0,0,$t)
    $pos = StringInStr($t, @LF)
    
    If $pos = 0 Then Exit
    $test = StringLeft($t, $pos -1)
    $t = StringTrimLeft($t, $pos)
    ConsoleWrite("-------" & @LF & $test & @LF)
    For $i = 0 To 10
        ConsoleWrite(ControlGetText("name", "", $test & $i) & @LF)
    Next
WEnd

Going to have a look at your link

Edited by Shevilie

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

Nice.. (Well the other gave a little after i modded it to)

$t = WinGetClassList("name")
$i = 0
While StringLen($t) > 0
;~  MsgBox(0,0,$t)
    $pos = StringInStr($t, @LF)
    
    If $pos = 0 Then Exit
    $test = StringLeft($t, $pos -1)
    $t = StringTrimLeft($t, $pos)
    ConsoleWrite("-------" & @LF & $test & @LF)
    For $i = 0 To 10
        ConsoleWrite(ControlGetText("name", "", $test & $i) & @LF)
    Next
WEnd

Going to have a look at our link

Yeah, if you know the Control "Type" and the range of numbers, that'd be fine :)

Just a hint, ControlGetHandle() returns 0 if it isn't found, so you may not need to continue your loop.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Fast spagethi... you know what I mean :D But I dont wanna redo the wheel, so I'll borrow you little UDF :)


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

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