usera Posted February 17, 2012 Share Posted February 17, 2012 Greeting, I had one application, open a windows, a button in the windows, I need use script to click on the button. the question is the window could be open in any area of the desktop, and the desktop screen size maybe different. how can I make sure I always click on that button use "Logical Position" of the application window, instead of "Physical position" of the desktop. Thanks usera Link to comment Share on other sites More sharing options...
AlmarM Posted February 17, 2012 Share Posted February 17, 2012 You mean that the button is always on the same coordinates in the window itself?If so, take a look at the Control functions. Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
usera Posted February 17, 2012 Author Share Posted February 17, 2012 You mean that the button is always on the same coordinates in the window itself?If so, take a look at the Control functions.thanks,Yes,tried control, but do not fully understand,is that possible can provide some sample? the help is not that good Link to comment Share on other sites More sharing options...
JohnQSmith Posted February 17, 2012 Share Posted February 17, 2012 (edited) the help is not that goodBLASPHEMY!!!In particular, ControlGetPos. Edited February 17, 2012 by JohnQSmith Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes". Link to comment Share on other sites More sharing options...
usera Posted February 17, 2012 Author Share Posted February 17, 2012 BLASPHEMY!!!In particular, ControlGetPos.sorry I just want to say help is not good for me to understand because i am new here. the Help itself is good! Link to comment Share on other sites More sharing options...
AlmarM Posted February 20, 2012 Share Posted February 20, 2012 Take a look at the functions WinGetTitle, ControlClick.Heres a little sample:HotKeySet("{F10}", "DoScript") Global $hWnd = GUICreate("SoftwareTitleHere") Global $hButton = GUICtrlCreateButton("Click me!", Random(10, 200, 1), Random(10, 350, 1), 200, 30) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $hButton MsgBox(0, "", "Button clicked!") EndSwitch WEnd Func DoScript() $sTitle = WinGetTitle("Software") ControlClick($sTitle, "", "[CLASS:Button;INSTANCE:1]", "left", 1) EndFuncYou can retreive the classname + instance number using the Au3Info.exe (C:Program Files (x86)AutoIt3). Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
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