Shyke Posted May 8, 2006 Posted May 8, 2006 Could someone tell me how to do this or atleast point me in the right direction because I can't think of how to do it right now.
Valuater Posted May 8, 2006 Posted May 8, 2006 maybe... If @DesktopWidth = 800 and @DesktopHeight = 640 Then ; do this ElseIf @DesktopWidth = 1024 and @DesktopHeight = 768 Then ; do this Else MsgBox(64, "Sorry", "Your Screen Resolution is non-compatable with this program ") EndIf 8)
Shyke Posted May 8, 2006 Author Posted May 8, 2006 Yeah, I already have that currently implemented but what if they use a resolution that my moniter doesn't support or they use this program with a resolution that is just really weird?
Valuater Posted May 8, 2006 Posted May 8, 2006 Shyke said: Yeah, I already have that currently implemented but what if they use a resolution that my moniter doesn't support or they use this program with a resolution that is just really weird? notice the last line??? Else MsgBox(64, "Sorry", "Your Screen Resolution is non-compatable with this program ") 8)
GioVit Posted May 8, 2006 Posted May 8, 2006 Shyke said: Could someone tell me how to do this or atleast point me in the right direction because I can't think of how to do it right now.may you explain more what you want to do?
scythetleppo Posted May 8, 2006 Posted May 8, 2006 GioVit said: may you explain more what you want to do?he wants to always click the correct button/area, no matter what screen resolution the user is on.
GioVit Posted May 8, 2006 Posted May 8, 2006 (edited) scythetleppo said: he wants to always click the correct button/area, no matter what screen resolution the user is on. 1 .- try to get the button name with AutoIt Window Info an then use the Function ControlClick or 2.- Func ClickRelative($x, $y) $Deltax = @DesktopWidth/1000 $Deltay = @DesktopHeight/1000 MouseClick("main", $x*$Deltax, $y*$Deltay) EndFunc Call this function with $x and $y between 0 and 1000 Edited May 8, 2006 by GioVit
Moderators SmOke_N Posted May 8, 2006 Moderators Posted May 8, 2006 (edited) Why not just use the Window or Client area/coords of the window you want to click to avoid a resolution issue? Edit: Typo Edited May 8, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
CyberSlug Posted May 8, 2006 Posted May 8, 2006 If your program depends on screen resolution, there is usually a better way to do what you are trying to accomplish. (Not always--but frequently.) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
ultor Posted May 9, 2006 Posted May 9, 2006 i am having the same problem too. I run scripts recorded with AutoIT recorder. I got the coordinates on the desktop computer with 1024X768 resolution, then when I run it on my notebook with the same resolution, the mouse click is off the mark. I suppose there is a smarter way of getting the mouseclick orientated on different pc/resolution?
MHz Posted May 9, 2006 Posted May 9, 2006 ultor said: I suppose there is a smarter way of getting the mouseclick orientated on different pc/resolution?Welcome ultor, Like as SmOke_N has stated. Use the client area of the active window. Use at the top of your script: Opt("MouseCoordMode", 2) and use AutoIt Info Tool with the setting in Options -> Coord Mode -> Client. Now change the MouseClicks within your script to the information that AutoIt Info Tool returns with new Coordinates within the active window. Or as CyberSlug is perhaps suggesting, use Control* functions if possible, to directly interact with controls.
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