Gee Posted October 5, 2008 Posted October 5, 2008 Hi, all I want click one button but Button Control Id about : 1500 --> 1550. So it very slow if i use: for $i = 1500 to 1550. For $i = 1500 To 1550 _click("Window", $i) Next Func _click($Win, $BTN_ID) Local $check_click WinWaitNotActive($Win) ControlClick($Win,"",$BTN_ID) EndFunc ===> Slow Search Control ID ? Thank for your help !
Zedna Posted October 5, 2008 Posted October 5, 2008 Look at this:http://www.autoitscript.com/forum/index.ph...c=32781&hl=Core is to use WinGetClassList() Resources UDF ResourcesEx UDF AutoIt Forum Search
Malkey Posted October 5, 2008 Posted October 5, 2008 Hi, all I want click one button but Button Control Id about : 1500 --> 1550. So it very slow if i use: for $i = 1500 to 1550. For $i = 1500 To 1550 _click("Window", $i) Next Func _click($Win, $BTN_ID) Local $check_click WinWaitNotActive($Win) ControlClick($Win,"",$BTN_ID) EndFunc ===> Slow Search Control ID ? Thank for your help !This is a related example. It may help you along. Click on test button. That will send a click to the first button. #include <GUIConstantsEx.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $Button_1, $Button_2, $msg,$hGUI,$iIdTarget $hGUI = GUICreate("My GUI Button") ; will create a dialog box that when displayed is centered Opt("GUICoordMode", 2) $Button_1 = GUICtrlCreateButton("Window Button", 10, 30, 100) $Button_2 = GUICtrlCreateButton("Button Test", 0, -1) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 MsgBox(0,"","Button Window clicked",0,$hGUI) Case $msg = $Button_2 _click("[TITLE:My GUI Button]", "[TEXT:Window Button]") EndSelect WEnd EndFunc ;==>Example Exit Func _click($Win, $BTN_ID) ;WinWaitNotActive($Win) ControlClick($Win,"",$BTN_ID,"left") EndFunc
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