Jump to content

ControlClick help


Jat421
 Share

Recommended Posts

Hi,

This is my first script. I have read the help file but I can get the ControlClick() to click on the LAN settings button. Here is my script so far. Thanks for any help!!

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>




Internet()

Func Internet()
    Local $Button_1, $Button_2, $msg
    GUICreate("Utilities - Build By Me") ; will create a dialog box that when displayed is centered

    Opt("GUICoordMode", 2)
    $Button_1 = GUICtrlCreateButton("Branch", 30, 30, 150)
    $Button_2 = GUICtrlCreateButton("Home", 0, -1)

    GUISetState()      ; will display an  dialog box with 2 button

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Button_1
                Runwait("RunDLL32.EXE shell32.dll,Control_RunDLL inetcpl.cpl,,4")
                WinActivate ("Internet Properties")
                ControlClick("Internet Properties", "", 1580)

                
                
                
            Case $msg = $Button_2
                MsgBox(0, 'Testing', 'Button 2 was pressed')    ; Will demonstrate Button 2 being pressed
        EndSelect
    WEnd
EndFunc
Link to comment
Share on other sites

Control Click is not the problem... Read the helpfile again under RunWait!

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Internet()

Func Internet()
    Local $Button_1, $Button_2, $msg
    GUICreate("Utilities - Build By Me") ; will create a dialog box that when displayed is centered

    Opt("GUICoordMode", 2)
    $Button_1 = GUICtrlCreateButton("Branch", 30, 30, 150)
    $Button_2 = GUICtrlCreateButton("Home", 0, -1)

    GUISetState()      ; will display an  dialog box with 2 button

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Button_1
                Run("RunDLL32.EXE shell32.dll,Control_RunDLL inetcpl.cpl,,4")
                WinWait("Internet Properties") ; <<< wait for window to be active!
                ControlClick("Internet Properties", "", 1580)
            Case $msg = $Button_2
                MsgBox(0, 'Testing', 'Button 2 was pressed')    ; Will demonstrate Button 2 being pressed
        EndSelect
    WEnd
EndFunc

Thats how you want it to be done I think.

Mat

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...