AutoHotkey Community

It is currently May 26th, 2012, 7:49 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: May 15th, 2009, 11:02 am 
Offline

Joined: February 11th, 2005, 6:31 am
Posts: 174
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 15th, 2009, 3:47 pm 
Quote:
is there a way to retrieve the name of control directly?
OK, once you gotm what dya wanna do withm?


Report this post
Top
  
Reply with quote  
PostPosted: May 15th, 2009, 5:11 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 17th, 2009, 7:03 am 
Offline

Joined: February 11th, 2005, 6:31 am
Posts: 174
Location: Germany
@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 :D


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, Azevedo, perlsmith and 66 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