GetTextInRect doesn't work with variables (in WinXP)

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

GetTextInRect doesn't work with variables (in WinXP)

Post by Jerry Thomas » Thu Sep 22, 2011 6:54 pm

- - Update - -
This is now working?????
I had to reboot (for a different issue) and when I came back to this, it works.

Self Healing software?



- - original post - -
I am trying to see the text of a button (not a standard Windows control so I have to do it the hard way).

Both of the following work on Win7 but not on WinXP (using MS Portable).
In XP, when I try to use variables for the coordinates, I get a blank.

Any suggestions?

Code: Select all

Let>XCoord=680
Let>YCoord=169
Let>Offset=30
Let>X1=XCoord-Offset
Let>Y1=YCoord-Offset
Let>X2=XCoord+Offset
Let>Y2=YCoord+Offset

//This does not work in XP
GetTextInRect>X1,Y1,X2,Y2,str1
MDL>str1

//This works in both
GetTextInRect>650,139,710,199,str2
MDL>str2
Thanks,
Jerry

[email protected]

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

Post by Marcus Tettmar » Fri Sep 23, 2011 7:44 am

I suspect the text capture hooks weren't loaded. Not that the variables weren't working. Worth putting GetTextReset at the top of your script. Which should force the libraries to reload.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Jerry Thomas
Macro Veteran
Posts: 267
Joined: Mon Sep 27, 2010 8:57 pm
Location: Seattle, WA

Post by Jerry Thomas » Fri Sep 23, 2011 6:19 pm

That makes sense.

Thanks!
Thanks,
Jerry

[email protected]

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