With vbs, one can use the "AppActivate" method to determine when a
window appears. While this may at first appear counter-intuitive,
(how can you appactivate something that isn't there) it does work.
You use AppActivate as a function. It will return false if the
window has not appeared as yet, and true when the window does
The usual strategy is to go into a loop, using appactivate to
test for the appearance of the window. (Its also a good idea
to put a sleep in the loop to allow the app to load).
As for part 2, that is a little more tricky. Most (er, um,
"well-programmed" apps) have "speed-keys" for their controls.
In other words, you may be able to click the "cancel" button
by sending an "alt-c" keystroke. Otherwise you may have to
send tab characters to give the focus to the control you want
and then a cr to implement (i.e., check a checkbox, or click
You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)