Suspends the running of the script until the #Ctrl-ID has received keyboard focus or until the repeat loops argument expires. The repeat-loops argument is an optional value, which defines the number of loop cycles that will be run. The repeat-loops value defaults to 3000 loops if nothing is set. As soon as focus is received, the script continues. As the following line illustrates, you can set the repeat-loop to never expire by setting the value to a negative number: WaitForFocus "#1065" "-1"
If the #Ctrl-ID is set to 0 (zero), it will loop until the window defined in the Dialog / EndDialog statement is given keyboard focus. NOTE: Do not place WaitForFocus commands within Dialog / EndDialog statements. |