Jump to content

Odd Window Behavior


Realm
 Share

Recommended Posts

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)<>$checksum

It 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 Posted Image

Edit: fixed some cut'n'paste typos

Edited 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

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

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 :graduated:

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

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...