Nucleus Posted October 4, 2005 Posted October 4, 2005 Example:; Serial Number$SN_1 = "*****-*****-*****-*****"Run ( @ProgramFilesDir & "\Softwin\BitDefender8\bdmcon.exe" ); Splash Screen$Title = "BitDefender 8 Professional Plus - Evaluation"WinWaitActive ( $Title )ControlClick ( $Title , "" , "Button1" ); Registration$Title = "BitDefender 8 Professional Plus - Registration"WinWaitActive ( $Title )$SN = StringSplit( $SN_1 , "-" )ControlSetText ( $Title , "" , "Edit1" , $SN[1] )ControlSetText ( $Title , "" , "Edit2" , $SN[2] )ControlSetText ( $Title , "" , "Edit3" , $SN[3] )ControlSetText ( $Title , "" , "Edit4" , $SN[4] )ControlClick ( $Title , "" , "Button1" ); Online #1$Title = "Online Registration"WinWaitActive ( $Title )ControlClick ( $Title , "" , "Button3" )ControlClick ( $Title , "" , "Button2" ); Online #2WinWaitActive ( $Title , "OK" )ControlClick ( $Title , "OK" , "Button1" )EXITMost of the times, this script works just fine. But sometimes, it gets stuck, mostly on the ; Splash Screen window. Why? Because for some reason it becomes inactive. All it needs is just a click on it, so that it can become active again, and the script continues.Is there a way, to modify this script, so that if the window becomes inactive, it will force it to become active again, and continue the registration?Thanks
MHz Posted October 4, 2005 Posted October 4, 2005 I fail to see the reason why you want the windows to be active. The Control*() functions directly operate the controls. You should try to use the text parameters if able to, if needed to prevent a similar window with the same title being recognized incorrectly.The Splash Screen may not be a problem then, as the script is not concerned if a window is active or not.Just change all the WinWaitActive() functions to WinWait() functions in your script. Then give it a test.
Ghost82 Posted October 4, 2005 Posted October 4, 2005 Try adding this:If WinExists( $Title ) then ; Check if the window exists WinActivate( $Title ) ; If so Activate itEndIf
MHz Posted October 4, 2005 Posted October 4, 2005 I fail to see the reason why you want the windows to be active. The Control*() functions directly operate the controls.<{POST_SNAPBACK}>Just to confirm that Control*() functions do not require active windows.
Nucleus Posted October 5, 2005 Author Posted October 5, 2005 (edited) Try adding this:If WinExists( $Title ) then ; Check if the window exists WinActivate( $Title ) ; If so Activate itEndIf<{POST_SNAPBACK}>i just added it at the top of the file Edited October 5, 2005 by Nucleus
MHz Posted October 5, 2005 Posted October 5, 2005 (edited) $Title was not declared before the WinExists function? You must declare or assign a value to a variable before using it, else you will receive the error as you display.Edit: Allow me to give example.; Declare a variableGlobal $Title; Assign a variable$Title = 'Here is a string' Edited October 5, 2005 by MHz
Ghost82 Posted October 5, 2005 Posted October 5, 2005 Try adding this:If WinExists( $Title ) then ; Check if the window exists WinActivate( $Title ) ; If so Activate itEndIf<{POST_SNAPBACK}>i just added it at the top of the file<{POST_SNAPBACK}>erhm....add it below this line:$Title = "BitDefender 8 Professional Plus - Evaluation"
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