AutoHotkey Community

It is currently May 26th, 2012, 8:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: control get text
PostPosted: April 18th, 2005, 9:11 am 
Offline

Joined: February 14th, 2005, 10:54 am
Posts: 447
Location: Texas, Usa
Code:
DetectHiddenText, On
#Persistent
SetTimer, WatchCursor, 50
return

WatchCursor:
MouseGetPos, X, Y, WindowId, ControlId,

ControlGetText, Text, %ControlId%

X += 10
Y += 10

ToolTip, Window Title: %WindowId% `n Text under mouse: ^%Text%^%ControlId%, %X%, %Y%
return

f9::Reload


is there any reason the above script does not get the text of the control the mouse is over. Is this a bug, am I dumb. whats up?

_________________
my lame sig :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 18th, 2005, 11:19 am 
Offline

Joined: April 18th, 2005, 11:03 am
Posts: 14
Location: WI, USA
Well here is what I have for a nice BRAND NEW SHINEY set of code.... (Mine is a little more fancy...even tho its not practical... just something I've been tinkering with.)

Code:
#Persistent
DetectHiddenText, On

SetTimer, WatchCursor, 50
return

WatchCursor:
MouseGetPos, X, Y, WIN, CONTROL
WinGetTitle, title, ahk_id %win%
ControlGetText, text, ahk_id %control%
PixelGetColor, color, X, Y, RGB
ToolTip, Title = "%title%"`nText = "%control%"`nX = "%X%"`nY = "%Y%"`nColor = "%color%"

return


As far as I'm looking at it, it would appear that when I assigned "WIN" to the output variable of MouseGetPos it picked it up... then used it in %win% in WinGetTitle. That works Beautiful....

I too however cannot get text of a control to appear... just the name of the control itself... which is rather annoying to have an illegitamate "Edit2" for text even though its the address bar of Internet Explorer and I should be seeing "http://www.autohotkey.com/forum/posting.php." I also tried the hidden text and got skunked on that as well. :evil:

Perhaps there is someone else out there who can help you mate... I did what I could. :roll:

_________________
"It was when I found out I could make mistakes that I knew I was on to something."
--Ornette Coleman


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 18th, 2005, 1:42 pm 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
Heres one I made earlier:

Code:
#persistent
#singleinstance force
setwindelay, -1
setbatchlines, -1

~capslock::

if A_PriorHotkey <> ~capslock
{
   KeyWait, capslock, D
   return
}

if A_TimeSincePriorHotkey > 400
{
   KeyWait, capslock, D
   return
}

If Get <> on
{
   SetTimer, Get, 50
}
else
{
   SetTimer, Get, off
   Get = Off
   ToolTip
}
return


Get:
  WinGetTitle, title, A
  WinGetClass, class, A
  if class = tooltips_class32
    tooltip
  else
    MouseGetPos, x, y, win, control, 1
    ControlGetText, text, %control%, ahk_class %class%
    tooltip, title:`t%title%`nclass:`t%class%`ncontrol:`t%control%`n%text%
    Get = on
    return

_________________
"Anything worth doing is worth doing slowly." - Mae West
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: control get text
PostPosted: April 18th, 2005, 2:43 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Invalid User wrote:
is there any reason the above script does not get the text of the control the mouse is over.
ControlGetText requires a WinTitle (or WinClass, etc.) whenever you don't want it to use the last found window. So I think all you need to fix it is:

ControlGetText, Text, %ControlId%, ahk_id %WindowId%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 18th, 2005, 8:30 pm 
Offline

Joined: February 14th, 2005, 10:54 am
Posts: 447
Location: Texas, Usa
I wonder who the lostboy is. I wonder...

Thanks chris, this works fine now. And feel free to move this thread under support
Code:
DetectHiddenText, On
#Persistent
SetTimer, WatchCursor, 50
return

WatchCursor:
MouseGetPos, X, Y, WindowId, ControlId,

ControlGetText, Text, %ControlId%, ahk_id %WindowId%

X += 10
Y += 10

ToolTip, Window Title: %WindowId% `n Text under mouse: ^%Text%^%ControlId%, %X%, %Y%
return

_________________
my lame sig :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 19th, 2005, 1:23 pm 
Offline

Joined: April 18th, 2005, 11:03 am
Posts: 14
Location: WI, USA
Invalid User wrote:
I wonder who the lostboy is. I wonder...


Lol... what can I say dude... you got me addicted... from friday 4.15 til' 4.18 I got quite literally ONE hour of sleep because I've been dinkin' around on this trying to catch up to you on it... AHK is dah bissidy bissidy bomb...

Oh yea... Mike Jones move over... i'ma gansta :roll: lol!

_________________
"It was when I found out I could make mistakes that I knew I was on to something."
--Ornette Coleman


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 19th, 2005, 7:54 pm 
Offline

Joined: February 14th, 2005, 10:54 am
Posts: 447
Location: Texas, Usa
hmm well i dont think its a race I think I win with this one I have been using ahk for sometime now, however you have been progging long before me

_________________
my lame sig :)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: poserpro, RaptorX, sjc1000 and 61 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group