WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: edmoran on February 26, 2015, 10:03:05 AM

Title: mousemove for all screen resolutions
Post by: edmoran on February 26, 2015, 10:03:05 AM
I have a script that uses many mousemoves and mouseclicks.  It finally works perfectly...for my screen resolution.  I have dual monitors at 1920x1080 resolution.  Now I need to make it work fine for two additional resolutions, or even better....for ANY resolution.  How do I go about making this script work properly?  I know I'll start by getting the users resolution with winmetrics(0) and (1).  But then do I need to multiply each coordinate by a certain factor?  If so, how do I go about calculating that factor?

Ed
Title: Re: mousemove for all screen resolutions
Post by: td on February 26, 2015, 01:20:08 PM
The coordinates you use with MouseMove or MousePlay are virtual screen coordinates.  This means that in theory you don't need to do anything when moving your script to systems with different resolutions.  There are a few caveats, however. 

.

Using window relative mouse coordinates can ameliorate some issues but cause others.

In short, test carefully.
Title: Re: mousemove for all screen resolutions
Post by: edmoran on March 04, 2015, 06:18:00 AM
The reason my script doesn't work is because the application I am trying to send mouse clicks to has a particular pixel size.  So it looks different under different screen resolutions.
Title: Re: mousemove for all screen resolutions
Post by: td on March 04, 2015, 08:14:44 AM
What precisely do you mean by 'particular pixel size'? If you mean that it has a fixed Windows virtual screen coordinate ( not the same as WinBatch virtual screen coordinates) size then you should be OK using Windows relative mouse moves.