I've made a PB program that takes magstripe data and keys it into a third-party application that I don't have direct access to. Currently, after swiping the card, the data is formatted, the third-party application is activated (SetForegroundWindow), I SLEEP for 1250 ms, and then I use SendInput to enter the information. This works most of the time.
Occasionally, if there are certain (high cpu) other programs running on the computer it takes slightly longer for the third-party application to appear and data is not entered.
Is there any way for me to check this third-party application to see if it is busy doing anything (appearing on screen, drawing its windows)? What would be the best approach? Check CPU usage, hook a message queue (?), etc.? I've looked at WaitFor*Object, but it doesn't appear it would be useful in this case.
Thanks!
Occasionally, if there are certain (high cpu) other programs running on the computer it takes slightly longer for the third-party application to appear and data is not entered.
Is there any way for me to check this third-party application to see if it is busy doing anything (appearing on screen, drawing its windows)? What would be the best approach? Check CPU usage, hook a message queue (?), etc.? I've looked at WaitFor*Object, but it doesn't appear it would be useful in this case.
Thanks!
Comment