Jump to content

How do I get the co-ordinates of mouse data entry "focus"


Recommended Posts

I am new to Autoit and I am looking  for a method to get the co-ordinates of  (for want of a better word) the "focus" of the data entry. 
I have attached a screen shot to illustrate what I mean.
The reason is that I am using the ("{TAB}") function to move from one data entry field to another to make entries.
At a letter point in my script I would like to return to a specific field to check the content. Trying to do this by using the ("{TAB}")  function to move back for x number of fields is an ugly solution. Also in some cases it does not work as the application has interdependencies that have an effect on the data entry fields depending on the data entered i.e. some new fields may have to be entered and some may be skipped. If I were able to get the co-ordinates of the data entry "focus" I could store these and use  the "MouseMove(314,457,20)" command to move directly to the required field when required.
I have have looked at the WinGetCaretPos and GUIGetCursorInfo commands but they do not seem to address this issue.
Any ideas?

 

Focus_vs_Cursor_Position.png

Link to comment
Share on other sites

I think it would be better for your to just interact with the control itself.

What application are you trying to automate? Mousemove or Mouseclick are not very good, because you can't multi task with it. Also, if the window is moved, then you need new coordinates again.

If you don't want to make the application public, you can always send it to me in a private message, so I can further help you. 

Link to comment
Share on other sites

Thanks for your input.
I have used an example but this requirement is of a general nature. I would like to create some smoke tests using autoit.
If I had a feature that could map the input fields it would be able to address them as required.
This would be really helpful.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...