Understanding GetControlText>

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
EnderFFX
Pro Scripter
Posts: 92
Joined: Mon Mar 08, 2004 6:17 am

Understanding GetControlText>

Post by EnderFFX » Thu Jan 17, 2008 7:25 pm

Any suggestion on how to go through all of the classes and instances of a window code wise to determine all control text of a window?

I'm getting text from a window through getcontroltext and i'm just trying to determine where it is from.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jan 17, 2008 7:29 pm

To get ALL control text of a window just use GetWindowText - it basically works by calling GetControlText for each control on the window.

To see what text these functions can retrieve use the "View System Windows" tool under the Tools menu.

You will be able to retrieve more text with the GetTextAt, GetTextInRect and GetWindowTextEx functions.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

EnderFFX
Pro Scripter
Posts: 92
Joined: Mon Mar 08, 2004 6:17 am

...

Post by EnderFFX » Thu Jan 17, 2008 7:41 pm

Can you explain how GetTextAtPoint works?

Is it working graphically to determine what text is within the area or is it pulling the control text from the location? I've read the description a couple times and it just seems too vague.

Thank you for the help.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jan 17, 2008 9:03 pm

Maybe this will help:
http://www.mjtnet.com/blog/2007/12/12/c ... reen-text/

GetTextAtPoint is given an X,Y screen coordinate and it retrieves whatever text can be detected at that point on the screen. These commands "listen" to other applications calling system functions such as "TextOut" thereby intercepting what text other apps send to the screen.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

EnderFFX
Pro Scripter
Posts: 92
Joined: Mon Mar 08, 2004 6:17 am

Post by EnderFFX » Thu Jan 17, 2008 9:23 pm

mtettmar wrote:Maybe this will help:
http://www.mjtnet.com/blog/2007/12/12/c ... reen-text/

GetTextAtPoint is given an X,Y screen coordinate and it retrieves whatever text can be detected at that point on the screen. These commands "listen" to other applications calling system functions such as "TextOut" thereby intercepting what text other apps send to the screen.
That helps and the blog helps as well. I'm probably going to need to run a few examples before my next questions. Thank you for your help!

addiktion
Newbie
Posts: 9
Joined: Wed Jan 30, 2008 7:32 am

Post by addiktion » Wed Jan 30, 2008 8:41 am

Is this specific GetTextAtPoint feature only in 10+?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jan 30, 2008 8:49 am

Yes, GetTextAtPoint, GetTextInRect and GetWindowTextEx were introduced with version 10:

http://www.mjtnet.com/mswhatsnew.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts