Sphaera_ORbis Posted May 30, 2005 Posted May 30, 2005 (edited) I get ControlCommand() called with illegal argument 4: "IsDisabled" (looked to good to be true) ;0Does anyone know the correct way to handle this??While 1If ControlCommand ("CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "" ) AND ControlCommand ("CCleaner", "Sluiten", 6, "IsEnabled", "" ) Then ExitloopIf ControlCommand ("CCleaner", "Herstel geselecteerde fouten...", 4, "IsDisabled", "" ) AND ControlCommand ("CCleaner", "Sluiten", 6, "IsEnabled", "" ) Then Sleep (2000)MsgBox ( 64, "Auto-CC", "Cleaning Completed" )ControlFocus ( "CCleaner", "Sluiten", 6 )ControlClick ( "CCleaner", "Sluiten", 6, "left" , 1 )Sleep (2000)ExitEndIfWEnd Edited May 30, 2005 by Sphaera_ORbis
TuMbLeWeEd Posted May 30, 2005 Posted May 30, 2005 (edited) I get ControlCommand() called with illegal argument 4: "IsDisabled" (looked to good to be true) ;0Does anyone know the correct way to handle this??While 1If ControlCommand ("CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "" ) AND ControlCommand ("CCleaner", "Sluiten", 6, "IsEnabled", "" ) Then ExitloopIf ControlCommand ("CCleaner", "Herstel geselecteerde fouten...", 4, "IsDisabled", "" ) AND ControlCommand ("CCleaner", "Sluiten", 6, "IsEnabled", "" ) Then Sleep (2000)MsgBox ( 64, "Auto-CC", "Cleaning Completed" )ControlFocus ( "CCleaner", "Sluiten", 6 )ControlClick ( "CCleaner", "Sluiten", 6, "left" , 1 )Sleep (2000)ExitEndIfWEnd<{POST_SNAPBACK}>some logic:If ControlCommand ("CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "" ) = 1 then the control is Enabled, when it returns 0, it's not enabled so If NOT ControlCommand ("CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "" ) then you check if it's "Disabled"There is no need to have 2 commands to check the same thing Edited May 30, 2005 by TuMbLeWeEd My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers
Sphaera_ORbis Posted May 30, 2005 Author Posted May 30, 2005 (edited) some logic:If ControlCommand ("CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "" ) = 1 then the control is Enabled, when it returns 0, it's not enabled so If NOT ControlCommand ("CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "" ) then you check if it's "Disabled"There is no need to have 2 commands to check the same thing<{POST_SNAPBACK}>Then i think this is the way it should work, let me know if you think otherwise.While 1$func1 = ControlCommand ("CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "" ) $func2 = ControlCommand ("CCleaner", "Sluiten", 6, "IsEnabled", "" ) If $func1 = 1 And $func2 = 1 Then ExitLoopIf $func1 = 0 And $func2 = 1 Then Sleep (2000)MsgBox ( 64, "Auto-CC", "Cleaning Completed" )ControlFocus ( "CCleaner", "Sluiten", 6 )ControlClick ( "CCleaner", "Sluiten", 6, "left" , 1 )Sleep (2000)ExitEndIfWEnd Edited May 30, 2005 by Sphaera_ORbis
MHz Posted May 31, 2005 Posted May 31, 2005 I downloaded the program to to see myself. When the program starts up, you will not see the progress bar. But, AutoIt info tool can see this progress bar hidden. This is a good method to know when this program is run, as it becomes visible, when cleaning process starts. When the progress bar is visible, and the run button becomes enabled, then the program cleaning process is complete. Then we just close it. If FileExists(@ProgramFilesDir & '\CCleaner\ccleaner.exe') Then Run(@ProgramFilesDir & '\CCleaner\ccleaner.exe') If WinWait('CCleaner') Then ; Optional window title change and sleep ;) If WinSetTitle('CCleaner', '', 'CCleaner - Automated by AutoIt3') Then Sleep(2000) ControlClick('CCleaner', '', 3) EndIf ; Close the temporary warning msgbox If WinWait('', 'Do not show me this message again', 2) Then ControlClick('', 'Do not show me this message again', 4) EndIf ; Progressbar is hidden, but when visible and run button is enabled, then we are finished. Do Sleep(500) Until ControlCommand('CCleaner', '', 8, 'IsVisible') And ControlCommand('CCleaner', '', 3, 'IsEnabled', '') WinClose('CCleaner') EndIf Added good spacing for good identification purposes only. Good luck
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