dushkin Posted April 27, 2010 Posted April 27, 2010 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!
MrMitchell Posted April 27, 2010 Posted April 27, 2010 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
dushkin Posted April 27, 2010 Author Posted April 27, 2010 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#MouseCoordModeThanks 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.
dushkin Posted April 29, 2010 Author Posted April 29, 2010 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.)
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