Jump to content

Get Cursor Position


Recommended Posts

G'day everyone

I'm running AutoIt scripts on a program that has an edit pane but no helpful control names etc. The program is OmegaT, by the way. I need to click with my mouse in a certain place, but the only way I can reference that place, is to say that it is 10 pixels above the cursor position. I mean, the exit box has a blinking cursor in it, and I need to find the pixel position of that cursor. As mentioned, the edit pane itself doesn't have a control name (the app OmegaT is written in Java, see).

Any ideas about how to get the cursor position? I was hoping for something along the lines of MouseGetPos, but if it aint that simple, I can improvise.

Thanks!

Samuel

Link to comment
Share on other sites

G'day everyone

I'm running AutoIt scripts on a program that has an edit pane but no helpful control names etc. The program is OmegaT, by the way. I need to click with my mouse in a certain place, but the only way I can reference that place, is to say that it is 10 pixels above the cursor position. I mean, the exit box has a blinking cursor in it, and I need to find the pixel position of that cursor. As mentioned, the edit pane itself doesn't have a control name (the app OmegaT is written in Java, see).

Any ideas about how to get the cursor position? I was hoping for something along the lines of MouseGetPos, but if it aint that simple, I can improvise.

Thanks!

Samuel

WinGetCaretPos ( ) should report the coordinates of the blinking caret. However the hepl file says some applications may not report the correct value, so I guess you will just have to try it to see if it works.

Edited by Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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...