Jump to content

MouseClick Question


PcExpert
 Share

Recommended Posts

Hi,

Howto make a program that clicks on every monitor size at the same place? For Example: You programmed a script to click at x: 125 and y: 125. When you excute the script on a computer with a 15 inch it clicks at x: 125 and y: 125, then you try the script on an 21 inch monitor and it clicks also at x: 125 and y: 125.

I Thought that the script must look like this:

MouseClick("left", @DesktopHeight 125, @DesktopWidth 125, 1)

But that doesn't work.

Thanks for your help

Link to comment
Share on other sites

I tested it. So the code I wrote was:

MouseClick("left", 341, 125, 1)

On the PC (with a 15,4" screen) where I wrote the script it clicks the right button, but when I excute the script at an other computer (with a 19" screen) It just clicks my desktop, not a button. Whats wrong? Tried it again, but then with only the mouseclick in the script, but that didn't work either.

Edited by PcExpert
Link to comment
Share on other sites

Actually, the problem is that he's asking the wrong question. The question isn't how do you click in the same spot on the screen. The MouseClick function does exactly that, regardless of what size the monitor is.

The question he should have asked is, how do I click on a (button, item, etc) in/on (notepad, IE, desktop, etc.).

Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

PaulIA, You're totally right! So my question is: how do I click on a button in/on notepad with different screen resolution?

That's partially why I chose the word I did in my previous post. The other reason was the invalid parameters, 2 and 3.

Anyway, I would recommend you to check out ControlClick, and the similar functions. What kind of application do you

want to interact with btw ?

Link to comment
Share on other sites

Use

Opt('MouseCoordMode', 2)

will allow relative coords to the client area of the active window. Remember to also set Window Info Tool to Client in Coord mode within Options to get the right coordinates to click on the target window.

That should help minimize resolution issues with mouseclicking on the windows.

:P

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