Thanks,
Billy Vick
Do Until Shell.AppActivate("MyWindow")
WScript.Sleep 100
Loop
"Billy Vick" <bv...@yahoo.com> wrote in message
news:uARucSh1$GA.196@cppssbbsa04...
: How do I wait for a windows to activate. I have an application that
:
:
:
While poking around with the VBA Object viewer, I saw that AppActivate
returned a value (like a function, though the documentation says its a
method and makes no mention of a return value), but I couldn't figure
out how to use it. Thanks for illuminating that for us, Walter.
(Where'd you come by that info?)
I might make a tiny suggestion though. Wouldn't be better to use a long
For loop - so that it eventually times out when something untoward
occurs. For example, ...
bActive = False
For I = 100 to 10000 Step 100
if Shell.AppActivate("MyWindow") Then
bActive = True
Exit For
End if
WScript.Sleep 100
Next
if not bActive Then
WSH.Echo "Timeout"
WSH.Quit(1001)
End if
BTW, Sleep and AppActivate first appeared (together) in WSH version 2.0.
Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
But, beware of using undocumented "features". If it's not documented, then
it just might be working as a result of some "inadvertant accident", (like,
the S_OK constant accidently being left in the return register), rather than
any overt intention on microsoft's part to make the life of a scripter any
easier. And then microsoft may step up and "correct" that accident at any
time...
(signed) Joe Gloomster
Tom Lavedas <lav...@pressroom.com> wrote in message
news:3947B7E3...@pressroom.com...