Jat421 Posted October 15, 2009 Posted October 15, 2009 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!!expandcollapse popup#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
Mat Posted October 15, 2009 Posted October 15, 2009 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 AutoIt Project Listing
Jat421 Posted October 15, 2009 Author Posted October 15, 2009 Thanks Mat. That's exactly what I needed!!!
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