Sign in to follow this  
Followers 0
AutoFalk3r

Waiting for Application Loading - WinWaitActive Insufficient

3 posts in this topic

#1 ·  Posted (edited)

Hey Guys, I'm new so go easy on me.

I need a script to monitor an application as it loads and run some simple Send() commands after it is up and running, however, WinWaitActive() seems to trigger the follow-on actions too early, so I'm attempting to create my own, more robust version.

My first attempt is to do something like this:

Func MyWWA($title)
     $CPU_Usage = 100
     While $CPU_Usage > 10
          WinActivate( "Windows Task Manager" )
          $text = WinGetText( "Windows Task Manager" )
          ; parse text to extract CPU Usage %
          ; if CPU Usage % > 10, then the application is still running
          ; Sleep 100
          WinWaitActive($title)
     Wend
EndFunc

It'll active an already open Windows Task Manager, read in the window text, parse it down to a 1~3 digit integer, and loop until the CPU calms down indicating the program is ready to go.

My first problem is the CPU Usage number only appears in the StatusBar of the windows task manager. How do I read this text into a variable?

My large-scale problem is even this is a crude method; what's a more reliable method?

Many thanks,

- Eric

Edited by AutoFalk3r

Share this post


Link to post
Share on other sites



Hey, look at that...

$text_input = StatusbarGetText( "Windows Task Manager", "", 2 )

That gets my crude method working. Anyone have any suggestions for further improvements? Added robustness?

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