Sign in to follow this  
Followers 0
Hello Me You

WinWait under condition ProcessExists

3 posts in this topic

Hello,

My script is as follows:

Opt("TrayIconHide", 1)
Run("D:\Programma's\Opera\Opera.exe")
While ProcessExists("opera.exe")
WinWait("Fout in het script voor Internet Explorer")
WinClose("Fout in het script voor Internet Explorer")
WEnd

Problem is: I want it to wait for a error dialog, but when the process opera.exe is terminated, I want the script to stop too. I can simply delete the WinWait, but that results in a permanent 90% CPU usage. I tried other things, like IfElse etc., but without WinWait, the script uses much to much CPU.

Is there a solution for this? Like, 'wait for this window, under the condition that opera.exe still exists' or 'wait for this window to exists, and for this window to close'.

Thanks in advance.


Random

Share this post


Link to post
Share on other sites



Putting a tiny Sleep in your loop will fix the CPU-usage problem.

Share this post


Link to post
Share on other sites

You guys are awesome! Thanks for the fast reply. It works perfectly!


Random

Share this post


Link to post
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
Sign in to follow this  
Followers 0