AutoFalk3r Posted October 13, 2011 Share Posted October 13, 2011 (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 October 13, 2011 by AutoFalk3r Link to comment Share on other sites More sharing options...
AutoFalk3r Posted October 13, 2011 Author Share Posted October 13, 2011 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? Link to comment Share on other sites More sharing options...
Zedna Posted October 14, 2011 Share Posted October 14, 2011 Search for CompInfo UDF. It uses WMI. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
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