AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Retrieve the name of a control by coordinates

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Andi



Joined: 11 Feb 2005
Posts: 173
Location: Germany

PostPosted: Fri May 15, 2009 10:02 am    Post subject: Retrieve the name of a control by coordinates Reply with quote

Hi,

is there a way to retrieve the name of control directly?
... or must I first to move the mouse and in step 2 using the mouseGetPos command?

I've got the x,y screen coordinates of the control:

Code:

MouseMove, x, y
MouseGetPos, , , id, control
msgbox, Name of control %control%


Thanks in advance
Back to top
View user's profile Send private message
DControl
Guest





PostPosted: Fri May 15, 2009 2:47 pm    Post subject: Reply with quote

Quote:
is there a way to retrieve the name of control directly?
OK, once you gotm what dya wanna do withm?
Back to top
almin
Guest





PostPosted: Fri May 15, 2009 4:11 pm    Post subject: Re: Retrieve the name of a control by coordinates Reply with quote

Andi wrote:
is there a way to retrieve the name of control directly

Yes, it can be done without using the mouse position.
The steps you need are:
1. convert your screen coords to window relative coords
2. Get a list of all controls for your window (WinGet, outVar, ControlList)
3. for each control in list, get its x,y,w,h (Loop, parse and ConrolGetPos)
4. if the window relative coords are in bounds of control's x,y,w,h
you now have the classNN of the control
Back to top
Andi



Joined: 11 Feb 2005
Posts: 173
Location: Germany

PostPosted: Sun May 17, 2009 6:03 am    Post subject: Reply with quote

@DControl:
I want to read the subject field of an e-mail program (Lotus Notes)
Unfortunaly, the name of the control changes it's name from one msg to another.

@almin:
Thank you, this seems to be a good workaround Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group