Sign in to follow this  
Followers 0
Gee

Help Search Control ID

3 posts in this topic

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 ? :P

Thank for your help !

Share this post


Link to post
Share on other sites



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 ? :P

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0