Jump to content

Control Text


Recommended Posts

Real quick question. Without displaying all of my code, here is a snippet that more or less tries to do the same thing. I want to get the text of a control that has focus. In this codes case I want to get the text from the start button. The Window Info tool says the Start Button has "Start" as the text. So why doesn't this work?

AutoItSetOption("WinDetectHiddenText", 1)
$var = ControlGetText("", "", 304)
MsgBox(0, "Start Button Text", $var)
Link to comment
Share on other sites

use the class since there is no window name

c2--><!--Ck9wdCgmcXVvdDtXaW5UaXRsZU1hdGNoTW9kZSZxdW90OywgNCkKQXV0b0l0U2V0T3B0aW9uKCZxdW90O1dpbkRldGVjdEhpZGRl
blRleHQmcXVvdDssIDEpCiYjMDM2O3ZhciA9IENvbnRyb2xHZXRUZXh0KCZxdW90O2NsYXNzbmFtZT1TaGVsbF9UcmF5V25kJnF1
b3Q7LCAmcXVvdDsmcXVvdDssIDMwNCkKTXNnQm94KDAsICZxdW90O1N0YXJ0IEJ1dHRvbiBUZXh0JnF1b3Q7LCAmIzAzNjt2YXIp
Cg==--><!--eg

did that work for you?

That it did. Thanks for the clarification on that.
Link to comment
Share on other sites

use the class since there is no window name

c2--><!--Ck9wdCgmcXVvdDtXaW5UaXRsZU1hdGNoTW9kZSZxdW90OywgNCkKQXV0b0l0U2V0T3B0aW9uKCZxdW90O1dpbkRldGVjdEhpZGRl
blRleHQmcXVvdDssIDEpCiYjMDM2O3ZhciA9IENvbnRyb2xHZXRUZXh0KCZxdW90O2NsYXNzbmFtZT1TaGVsbF9UcmF5V25kJnF1
b3Q7LCAmcXVvdDsmcXVvdDssIDMwNCkKTXNnQm94KDAsICZxdW90O1N0YXJ0IEJ1dHRvbiBUZXh0JnF1b3Q7LCAmIzAzNjt2YXIp
Cg==--><!--eg

did that work for you?

To continue down this line of questioning, what command or UDF can I use to find the class name of the window that has focus?
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...