Jump to content

Recommended Posts

Posted (edited)

I am trying to understand why MouseClick will not click on the window if the window's position on a second screen is very low. 
Trying to clarify, I have 2 monitors.  One in landscape at 2560x1440, another in portrait at 1440x2560.  ::EDIT:: Scaling is set to 100% on both.

They are aligned like this:

image.png.195b61e809475272cd7109999217a387.png

If the window I am trying to click on is on monitor "1" and the first mouse click is below 1440, the mouse will click on the edge of monitor "1". Then it will lose window focus and the rest of the clicks will be wrong. 

If the window is anywhere on monitor "2", this does not seem to be a problem. 

If I align the bottom of monitors 1 & 2 to be the same, there does not seem to be a problem on any monitor.   Of course I can't control how others set up their monitors and displays, so I can't rely on this. 

Sample code that I used to test on Notepad and Explorer. 

Opt('MouseCoordMode',0)     ;0 = relative coords to the active window
;WinActivate("[TITLE:Untitled - Notepad; CLASS:Notepad]")
WinActivate("[TITLE:This PC; CLASS:CabinetWClass]")
MouseClick('left',323,174,1,1)
Sleep(1136)
MouseClick('left',410,20,1,1)
Sleep(1398)
MouseClick('left',710,295,1,1)
Sleep(4134)

 

Thoughts/ideas of how to address this? 

Edited by Mavnus04

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
  • Recently Browsing   0 members

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