Jump to content

what is better to use?


 Share

Recommended Posts

What is better to use: winwait or winwaitactive?

well, what is better an apple or an orange? I guess that depends on what you want to eat.

It's that same with the two functions you mentioned. All depends on what you want to do.

WinWaitActive

Pauses execution of the script until the requested window is active.

WinWait

Pauses execution of the script until the requested window exists.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Use both!

Run($file)  ; spawns $window
WinWait($window)
WinWaitActive($window)
 oÝ÷ ØêãºËn±ç(Úèǧu«­¢+Ø)IÕ¸ ÀÌØí¥±¤ìÍÁݹÌÀÌØíÝ¥¹½Ü)]¥¹]¥Ð ÀÌØíÝ¥¹½Ü¤)
½¹Ñɽ±M¹ ÀÌØíÝ¥¹½Ü°ÅÕ½ÐìÅÕ½Ðì°ÀÌØí½¹Ñɽ°°ÀÌØíÑáФ(
Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Use both!

Why??? What does WinWait() what WinWaitActive() does not do, based on your proposed use??

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

I just like apples and oranges in a fruit salad.

Erm, no it's not. It's rather like this: Actually, I want to an apple, but I do eat an orange beforehand, just to be sure the apple will taste well .... It just makes no sense at all.....

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

That's the right think todo to work with an activated window ;)

I figured since we had apples and oranges - we needed to add some mixed nuts to the party.

@OP,

Seriously, I should also mention that if anyone does use all 3 of those (like I do) you will probably want to set the Opt for WinWaitDelay to something less than the default 250 milliseconds.

From the helpfile for Opt...WinWaitDelay:

Alters how long a script should briefly pause after a successful window-related operation.

If I understand WinWaitDelay correctly:
Run($file)  ;spawns $window
WinWait($window)
;waits 250 milliseconds after the window is present

WinActivate($window)
;activates window and then waits 250 milliseconds

WinWaitActive($window)
;waits 250 milliseconds after the window is active
This probably would not matter to a simple app install script, but I have several scripts that setting WinWaitDelay to 1 or 5 makes a big difference. Thousands of windows to wait for...

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Thank you for all of your explanations. It explains a few things.

winwaitdelay does the same thing as winwaitactive but adds a longer time wait period. Right?

PS. I am still new to this visual stuff. It is very different than the way I learned how to program.

RUN . . . Slide . . . TAG . . . Your out . . . PAINTBALL !!!

Link to comment
Share on other sites

winwaitdelay does the same thing as winwaitactive but adds a longer time wait period. Right?

No! Read the posts again! winwaitdelay is NOT a function.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

I'm glad that you "got it" - just in case others cannot make sense of my ramblings... here is the code with the "Opt" or "AutoItSetOption" line that I was mentioning:

;either
Opt("WinWaitDelay", 5)
;or
AutoItSetOption("WinWaitDelay", 5)

Run($file)  ;spawns $window
WinWait($window)
;waits 5 milliseconds after the window is present

WinActivate($window)
;activates window and then waits 5 milliseconds

WinWaitActive($window)
;waits 5 milliseconds after the window is active

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...