Mavnus04 Posted February 2, 2022 Posted February 2, 2022 (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: 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 February 2, 2022 by Mavnus04
Danp2 Posted February 2, 2022 Posted February 2, 2022 I'm guessing that you have Windows set to scale one or both monitors to something other than 100%. You may want to search the forum for past discussions. Some examples are -- Latest Webdriver UDF Release Webdriver Wiki FAQs
Mavnus04 Posted February 2, 2022 Author Posted February 2, 2022 Sorry, should have mentioned. Scaling is at 100% on both.
BigDaddyO Posted February 4, 2022 Posted February 4, 2022 Try setting the Mouseclick speed to 0 with 1 it moves the mouse which perhaps is getting stuck on the ledge of monitor 2.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now