Realm Posted November 21, 2010 Share Posted November 21, 2010 (edited) A friend of mine, sent me a Task Scheduler a while back, and lately I have found some use for it. The automation works fine, but I have found a minor odd behavior. The first time I run the script after a PC Restart, it cannot locate the window. I have tried a normal WinWaitActive(), However the window fires as active long before the graphics appear. so I tried this:$checksum=PixelChecksum(100,200,100,100) ShellExecute("WinSchedPlus.exe","", @ProgramFilesDir & "\Schedule Plus\") Do _WinWaitActivate("Schedule Plus") Sleep(100) Until PixelChecksum(100,200,100,100)<>$checksumIt works great, except for the first time ran. After starting my pc, or doing a restart, I run my script which opens the application, but does not locate the window ever. If I close my script and the application, the script above will then work numerous times until the next pc restart.Besides WinWaitActive, or pixel checking, are there any other ways to detect when the GUI of an application is present and ready for automation on the screen?Realm Edit: fixed some cut'n'paste typos Edited November 21, 2010 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted November 21, 2010 Share Posted November 21, 2010 Besides WinWaitActive, or pixel checking, are there any other ways to detect when the GUI of an application is present and ready for automation on the screen?Maybe this function, WinGetState, can be used here. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Realm Posted November 21, 2010 Author Share Posted November 21, 2010 somdcomputerguy, I am not sure, but I would believe that WinGetStat and WinWaitActive work under the same protocols, thus it will detect the window is open and proceed with the rest of the script before the actual GUI is present. This was my initial problem with WinWaitActive. Which failed with each and every attempt. However with PixelChecksum I was able to get to detect the GUI every time, except the first time after booting up my pc or restarting it. For some reason, the GUI acts transparent to Pixelchecksum, but only the first time. However I will give it a shot in a few hours, and see if there is any difference. Thanks for your response. Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted November 21, 2010 Share Posted November 21, 2010 However I will give it a shot in a few hours, and see if there is any difference.Good Luck! - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Realm Posted November 22, 2010 Author Share Posted November 22, 2010 I finally had a chance to try that this morning. It worked the first try. guess I was wrong in assuming they both worked under the same protocols. Thanks for suggesting it somdcomputerguy Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted November 22, 2010 Share Posted November 22, 2010 Cool. Glad it worked out for you. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. 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