Jump to content
Sign in to follow this  
dushkin

Screen Resolution Adjustments

Recommended Posts

dushkin

Hi All,

When you are using object coordinates in the script, for mouse click, etc. ,how do you make the script compatible with different screen resolutions?

I read that I should better use the ControlClick Coords from the window info tool because they represent client coordinates, but sometimes the point I need the mouse to click is in an embedded window control, and in that case, how do I reference the mouse coordinates to the specific window control?

I also thought that calculating the new coordinates according to the proportion between the resolutions would do the trick, but it of course didn't...

I would appreciate your advice.

Thanks!

Share this post


Link to post
Share on other sites
dushkin

If you can't use ControlClick or similar Control functions on your window, then try changing MouseCoordMode: http://dundats.mvps.org/help/html/functions/AutoItSetOption.htm#MouseCoordMode

Thanks MrMitchell.

I am not sure it will help in the case of an embedded window.

Suppose I have a click on an a word written inside a rich edit box (control). The ControlClick coords from the window tool gives me the same coordinates from the upper left point of the Edit control box, but the MosueClick (also after changing the MouseCoordMode modes to client modes 0 or 2) refers to the parent window (with the title) 0,0 point as the origin point, which makes me the problem.

Share this post


Link to post
Share on other sites
dushkin

Thanks MrMitchell.

I am not sure it will help in the case of an embedded window.

Suppose I have a click on an a word written inside a rich edit box (control). The ControlClick coords from the window tool gives me the same coordinates from the upper left point of the Edit control box, but the MosueClick (also after changing the MouseCoordMode modes to client modes 0 or 2) refers to the parent window (with the title) 0,0 point as the origin point, which makes me the problem.

Ok, I think I got it...

1. Set Opt("MouseCoordMode", 0)

2. Get Client coordinates of the point to be clicked\processed using a tool like PAINT.NET (freeware)

(Unfortunately , the Autoit window Info tool does not get the requested coordinates.)

Share this post


Link to post
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
Sign in to follow this  

×