Somebody Someware Posted August 26, 2006 Share Posted August 26, 2006 All right, Problem 1: I made this script: expandcollapse popup; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: Ruben van Os <rubenvanos@gmail.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- ; Script Start - Add your code below here Opt("TrayIconDebug", 1) Opt("MouseCoordMode", 2) $wijd=@DesktopWidth Opt("GUICoordMode",2) If FileExists("C:\Program Files\Extreme Cleaner\EASYCLEANER\") Then TrayTip ( "Extreme Cleaner", "EasyCleaner data is gevonden.", 30 , 1) Else #include <GUIConstants.au3> GUICreate ( "Extreme Cleaner, EasyCleaner data niet gevonden! Wilt u dit automatish downloaden en installeren?" , $wijd , 100 , 0 , 0 , $DS_SETFOREGROUND, -1 , -1 ) $easycleanerautoja = GUICtrlCreateButton ( "Ja", -1, -1 , 200 , 100 , -1 , -1 ) $easycleanerautonee = GUICtrlCreateButton ( "Nee", 0, -1) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerautoja GUISetState ( @SW_HIDE , -1 ) Run("C:\EClea2_0.exe") WinWaitActive("EasyCleaner - InstallShield Wizard") Sleep("5000") Send("{ALTDOWN}") Send("{N}") Send("{ALTUP}") #include <GUIConstants.au3> GUICreate ( "Extreme Cleaner, gaat u akkoord met deze licentie overeenkomst?" , $wijd , 100 , 0 , 0 , $DS_SETFOREGROUND, -1 , -1 ) $easycleanerja = GUICtrlCreateButton ( "Ja", -1, -1 , 200 , 100 , -1 , -1 ) $easycleanernee = GUICtrlCreateButton ( "Nee", 0, -1) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerja GUISetState ( @SW_HIDE , -1 ) Send("{ALTDOWN}") Send("{Y}") Send("{ALTUP}") Sleep("1000") Send ( "{ALTDOWN}") Send("C") Send("{ALTUP}") Sleep("5000") Send("C:\Program Files\Extreme Cleaner\EASYCLEANER") Send("{ENTER}") Sleep("1000") Send("{ALTDOWN}") Send("N") Send("{ALTUP}") Send("{ALTDOWN}") Send("I") Send("{ALTUP}") EndSelect WEnd EndSelect EndIf but it gives me the following error: Line 84 (File "C:\Extreme Cleaner\Nieuw - AutoIt v3 Script.au2"): EndIf Error: "While" statement has no matching "Wend" statement. Problem 2: How do I make the script wait until a specified control is hidden? Help me please! Go to This site for my best product! Link to comment Share on other sites More sharing options...
amanda089 Posted August 26, 2006 Share Posted August 26, 2006 Add WEnd above the last EndIf Link to comment Share on other sites More sharing options...
Somebody Someware Posted August 26, 2006 Author Share Posted August 26, 2006 (edited) Add WEnd above the last EndIf Thank you for the help, I have now discovered an other problem: My GUI's won't show up what means that the script downloads and installs EasyCleaner 2.0 without asking, can anybody help with this? The updated code: expandcollapse popup; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: Ruben van Os <rubenvanos@gmail.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- ; Script Start - Add your code below here Opt("TrayIconDebug", 1) Opt("MouseCoordMode", 2) $wijd=@DesktopWidth Opt("GUICoordMode",2) If FileExists("C:\Program Files\Extreme Cleaner\EASYCLEANER\1") Then TrayTip ( "Extreme Cleaner", "EasyCleaner data is gevonden.", 30 , 1) Else #include <GUIConstants.au3> GUICreate ( "Extreme Cleaner, EasyCleaner data niet gevonden! Wilt u dit automatish downloaden en installeren?" , $wijd , 100 , 0 , 0 , $DS_SETFOREGROUND, -1 , -1 ) $easycleanerautoja = GUICtrlCreateButton ( "Ja", -1, -1 , 200 , 100 , -1 , -1 ) $easycleanerautonee = GUICtrlCreateButton ( "Nee", 0, -1) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerautoja GUISetState ( @SW_HIDE , -1 ) Run("C:\EClea2_0.exe") WinWaitActive("EasyCleaner - InstallShield Wizard") Sleep("5000") Send("{ALTDOWN}") Send("{N}") Send("{ALTUP}") #include <GUIConstants.au3> GUICreate ( "Extreme Cleaner, gaat u akkoord met deze licentie overeenkomst?" , $wijd , 100 , 0 , 0 , $DS_SETFOREGROUND, -1 , -1 ) $easycleanerja = GUICtrlCreateButton ( "Ja", -1, -1 , 200 , 100 , -1 , -1 ) $easycleanernee = GUICtrlCreateButton ( "Nee", 0, -1) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerja GUISetState ( @SW_HIDE , -1 ) Send("{ALTDOWN}") Send("{Y}") Send("{ALTUP}") Sleep("1000") Send ( "{ALTDOWN}") Send("C") Send("{ALTUP}") Sleep("5000") Send("C:\Program Files\Extreme Cleaner\EASYCLEANER") Send("{ENTER}") Sleep("1000") Send("{ALTDOWN}") Send("N") Send("{ALTUP}") Send("{ALTDOWN}") Send("I") Send("{ALTUP}") EndSelect WEnd EndSelect WEnd EndIf Edited August 26, 2006 by Somebody Someware Go to This site for my best product! Link to comment Share on other sites More sharing options...
MHz Posted August 26, 2006 Share Posted August 26, 2006 (edited) You were using a style as an extended style. I made some changes to get it working using some gui handles also. expandcollapse popup#include <GUIConstants.au3> Opt("TrayIconDebug", 1) Opt("MouseCoordMode", 2) $wijd = @DesktopWidth Opt("GUICoordMode", 2) If FileExists(@ProgramFilesDir & "\Extreme Cleaner\EASYCLEANER\1") Then TrayTip("Extreme Cleaner", "EasyCleaner data is gevonden.", 30, 1) Else $handle_gui_1 = GUICreate("Extreme Cleaner, EasyCleaner data niet gevonden! Wilt u dit automatish downloaden en installeren?", $wijd, 100, 0, $DS_SETFOREGROUND) $easycleanerautoja = GUICtrlCreateButton("Ja", 0, 0, 200, 100, -1, -1) $easycleanerautonee = GUICtrlCreateButton("Nee", 0, 0) GUISetState(@SW_SHOW, $handle_gui_1) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerautoja GUISetState(@SW_HIDE, $handle_gui_1) Run("C:\EClea2_0.exe") WinWaitActive("EasyCleaner - InstallShield Wizard") Sleep("5000") Send("{ALTDOWN}") Send("{N}") Send("{ALTUP}") $handle_gui_2 = GUICreate("Extreme Cleaner, gaat u akkoord met deze licentie overeenkomst?", $wijd, 100, 0, $DS_SETFOREGROUND) $easycleanerja = GUICtrlCreateButton("Ja", -1, -1, 200, 100, -1, -1) $easycleanernee = GUICtrlCreateButton("Nee", 0, -1) GUISetState(@SW_SHOW, $handle_gui_2) GUISwitch($handle_gui_2) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerja GUISetState(@SW_HIDE, $handle_gui_2) Send("{ALTDOWN}") Send("{Y}") Send("{ALTUP}") Sleep("1000") Send("{ALTDOWN}") Send("C") Send("{ALTUP}") Sleep("5000") Send("C:\Program Files\Extreme Cleaner\EASYCLEANER") Send("{ENTER}") Sleep("1000") Send("{ALTDOWN}") Send("N") Send("{ALTUP}") Send("{ALTDOWN}") Send("I") Send("{ALTUP}") EndSelect WEnd EndSelect WEnd EndIf And please consider making use of the gui forum for gui code next time. Edited August 26, 2006 by MHz Link to comment Share on other sites More sharing options...
amanda089 Posted August 26, 2006 Share Posted August 26, 2006 Use this code, I fixes several syntax errors: expandcollapse popup; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: Ruben van Os <rubenvanos@gmail.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- ; Script Start - Add your code below here Opt("TrayIconDebug", 1) Opt("MouseCoordMode", 2) $wijd=@DesktopWidth Opt("GUICoordMode",2) #include <GUIConstants.au3> If FileExists("C:\Program Files\Extreme Cleaner\EASYCLEANER\1") Then TrayTip ( "Extreme Cleaner", "EasyCleaner data is gevonden.", 30 , 1) Else Downloaden() NameThisFunction() EndIf Func Downloaden() GUICreate ( "Extreme Cleaner, EasyCleaner data niet gevonden! Wilt u dit automatish downloaden en installeren?" , $wijd , 100 , 0 , 0 , $DS_SETFOREGROUND, -1 , -1 ) $easycleanerautoja = GUICtrlCreateButton ( "Ja", -1, -1 , 200 , 100 , -1 , -1 ) $easycleanerautonee = GUICtrlCreateButton ( "Nee", 0, -1) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerautoja GUISetState ( @SW_HIDE , -1 ) Run("C:\EClea2_0.exe") WinWaitActive("EasyCleaner - InstallShield Wizard") Sleep("5000") Send("{ALTDOWN}") Send("{N}") Send("{ALTUP}") EndSelect WEnd EndFunc Func NameThisFunction() GUICreate ( "Extreme Cleaner, gaat u akkoord met deze licentie overeenkomst?" , $wijd , 100 , 0 , 0 , $DS_SETFOREGROUND, -1 , -1 ) $easycleanerja = GUICtrlCreateButton ( "Ja", -1, -1 , 200 , 100 , -1 , -1 ) $easycleanernee = GUICtrlCreateButton ( "Nee", 0, -1) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerja GUISetState ( @SW_HIDE , -1 ) Send("{ALTDOWN}") Send("{Y}") Send("{ALTUP}") Sleep("1000") Send ( "{ALTDOWN}") Send("C") Send("{ALTUP}") Sleep("5000") Send("C:\Program Files\Extreme Cleaner\EASYCLEANER") Send("{ENTER}") Sleep("1000") Send("{ALTDOWN}") Send("N") Send("{ALTUP}") Send("{ALTDOWN}") Send("I") Send("{ALTUP}") Case Default ;;;; EndSelect WEnd EndFunc You still have some work to do with it, I encapsulated the GUI's for reuseability. Link to comment Share on other sites More sharing options...
Somebody Someware Posted August 26, 2006 Author Share Posted August 26, 2006 You were using a style as an extended style. I made some changes to get it working using some gui handles also.And please consider making use of the gui forum for gui code next time.The original problem wasn't an GUI problem: see the first post. Go to This site for my best product! Link to comment Share on other sites More sharing options...
Somebody Someware Posted August 26, 2006 Author Share Posted August 26, 2006 Use this code, I fixes several syntax errors: expandcollapse popup; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: Ruben van Os <rubenvanos@gmail.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- ; Script Start - Add your code below here Opt("TrayIconDebug", 1) Opt("MouseCoordMode", 2) $wijd=@DesktopWidth Opt("GUICoordMode",2) #include <GUIConstants.au3> If FileExists("C:\Program Files\Extreme Cleaner\EASYCLEANER\1") Then TrayTip ( "Extreme Cleaner", "EasyCleaner data is gevonden.", 30 , 1) Else Downloaden() NameThisFunction() EndIf Func Downloaden() GUICreate ( "Extreme Cleaner, EasyCleaner data niet gevonden! Wilt u dit automatish downloaden en installeren?" , $wijd , 100 , 0 , 0 , $DS_SETFOREGROUND, -1 , -1 ) $easycleanerautoja = GUICtrlCreateButton ( "Ja", -1, -1 , 200 , 100 , -1 , -1 ) $easycleanerautonee = GUICtrlCreateButton ( "Nee", 0, -1) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerautoja GUISetState ( @SW_HIDE , -1 ) Run("C:\EClea2_0.exe") WinWaitActive("EasyCleaner - InstallShield Wizard") Sleep("5000") Send("{ALTDOWN}") Send("{N}") Send("{ALTUP}") EndSelect WEnd EndFunc Func NameThisFunction() GUICreate ( "Extreme Cleaner, gaat u akkoord met deze licentie overeenkomst?" , $wijd , 100 , 0 , 0 , $DS_SETFOREGROUND, -1 , -1 ) $easycleanerja = GUICtrlCreateButton ( "Ja", -1, -1 , 200 , 100 , -1 , -1 ) $easycleanernee = GUICtrlCreateButton ( "Nee", 0, -1) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerja GUISetState ( @SW_HIDE , -1 ) Send("{ALTDOWN}") Send("{Y}") Send("{ALTUP}") Sleep("1000") Send ( "{ALTDOWN}") Send("C") Send("{ALTUP}") Sleep("5000") Send("C:\Program Files\Extreme Cleaner\EASYCLEANER") Send("{ENTER}") Sleep("1000") Send("{ALTDOWN}") Send("N") Send("{ALTUP}") Send("{ALTDOWN}") Send("I") Send("{ALTUP}") Case Default ;;;; EndSelect WEnd EndFunc You still have some work to do with it, I encapsulated the GUI's for reuseability. I have tried your code but the only thing it does is restarting the Installshield wizard making it crash. Go to This site for my best product! Link to comment Share on other sites More sharing options...
Somebody Someware Posted August 26, 2006 Author Share Posted August 26, 2006 You were using a style as an extended style. I made some changes to get it working using some gui handles also. expandcollapse popup#include <GUIConstants.au3> Opt("TrayIconDebug", 1) Opt("MouseCoordMode", 2) $wijd = @DesktopWidth Opt("GUICoordMode", 2) If FileExists(@ProgramFilesDir & "\Extreme Cleaner\EASYCLEANER\1") Then TrayTip("Extreme Cleaner", "EasyCleaner data is gevonden.", 30, 1) Else $handle_gui_1 = GUICreate("Extreme Cleaner, EasyCleaner data niet gevonden! Wilt u dit automatish downloaden en installeren?", $wijd, 100, 0, $DS_SETFOREGROUND) $easycleanerautoja = GUICtrlCreateButton("Ja", 0, 0, 200, 100, -1, -1) $easycleanerautonee = GUICtrlCreateButton("Nee", 0, 0) GUISetState(@SW_SHOW, $handle_gui_1) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerautoja GUISetState(@SW_HIDE, $handle_gui_1) Run("C:\EClea2_0.exe") WinWaitActive("EasyCleaner - InstallShield Wizard") Sleep("5000") Send("{ALTDOWN}") Send("{N}") Send("{ALTUP}") $handle_gui_2 = GUICreate("Extreme Cleaner, gaat u akkoord met deze licentie overeenkomst?", $wijd, 100, 0, $DS_SETFOREGROUND) $easycleanerja = GUICtrlCreateButton("Ja", -1, -1, 200, 100, -1, -1) $easycleanernee = GUICtrlCreateButton("Nee", 0, -1) GUISetState(@SW_SHOW, $handle_gui_2) GUISwitch($handle_gui_2) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $GUI_EVENT_MINIMIZE Case $msg = $GUI_EVENT_MAXIMIZE Case $msg = $easycleanerja GUISetState(@SW_HIDE, $handle_gui_2) Send("{ALTDOWN}") Send("{Y}") Send("{ALTUP}") Sleep("1000") Send("{ALTDOWN}") Send("C") Send("{ALTUP}") Sleep("5000") Send("C:\Program Files\Extreme Cleaner\EASYCLEANER") Send("{ENTER}") Sleep("1000") Send("{ALTDOWN}") Send("N") Send("{ALTUP}") Send("{ALTDOWN}") Send("I") Send("{ALTUP}") EndSelect WEnd EndSelect WEnd EndIf And please consider making use of the gui forum for gui code next time. Your code was great MHz only the first dialog is missing the "Nee" button Go to This site for my best product! 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