decon8x Posted March 5, 2010 Posted March 5, 2010 Please look the code below Func StartButton() $coord = PixelSearch (0, 0, 1440, 900, 0x7D5347 ) If Not @error Then Sleep (1000) MouseClick ("left", $coord[0], $coord[1] ) EndIf EndFunc This code work fine, the mouse is click right coord. But when i try ControlClick as below Func StartButton() $coord = PixelSearch (0, 0, 1440, 900, 0x7D5347 ) If Not @error Then Sleep (1000) ControlClick ("Untitled - Google Chrome", "", "[CLASS:NativeWindowClass; INSTANCE:1]", "left", $coord[0], $coord[1]) EndIf EndFunc It's work too but the mouse click wrong coord, please help
somdcomputerguy Posted March 5, 2010 Posted March 5, 2010 Perhaps MouseClick and ControlClick use different defaults, so set this, MouseCoordMode (Option). - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
PsaltyDS Posted March 5, 2010 Posted March 5, 2010 The coordinates in ControlClick() are relative to the control itself. It only indicates where inside the control to click (the default is the center of the control). This is not affected by any of the Opt() settings. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
decon8x Posted March 6, 2010 Author Posted March 6, 2010 Everybody please help, i have search and read around but did not find any helpful. I'm wondering what ControlClick() can do while it click wrong coord even after extract coord is added
JohnOne Posted March 6, 2010 Posted March 6, 2010 Everybody please help, i have search and read around but did not find any helpful. I'm wondering what ControlClick() can do while it click wrong coord even after extract coord is added You want to try and look at the helpfile for ControlClick, specifically the params, because you are doing it wrong. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
decon8x Posted March 6, 2010 Author Posted March 6, 2010 Aww, just checked, my fault lol Anybody know how to get ControlClick Coord like PixelSearch as i've said on 1st post?
Tvern Posted March 6, 2010 Posted March 6, 2010 Aww, just checked, my fault lol Anybody know how to get ControlClick Coord like PixelSearch as i've said on 1st post?Do you just want to click the control, because that means you don't have to specify coords at all.If you want to click the control in a specific location, then you could get the coordinates of the control and calculate the relative coordinates that way, but in that case there is little reason for using controlclick in the first place unless the window is and should stay partially obstructed.In short: just remove the coordinates all together.
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