 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Andi
Joined: 11 Feb 2005 Posts: 173 Location: Germany
|
Posted: Fri May 15, 2009 10:02 am Post subject: Retrieve the name of a control by coordinates |
|
|
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 |
|
 |
DControl Guest
|
Posted: Fri May 15, 2009 2:47 pm Post subject: |
|
|
| 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
|
Posted: Fri May 15, 2009 4:11 pm Post subject: Re: Retrieve the name of a control by coordinates |
|
|
| 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
|
Posted: Sun May 17, 2009 6:03 am Post subject: |
|
|
@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  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|