WaitWindowOpen anomaly I'm encountering

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
JRS
Pro Scripter
Posts: 71
Joined: Thu Nov 04, 2004 5:19 am

WaitWindowOpen anomaly I'm encountering

Post by JRS » Sun Feb 25, 2007 3:08 pm

Hello All,

I looked around to see if my issue has discussed before
and didn't find any references. If it is a duplicate I'm
sorry.

I'm using Macro Scheduler Ver. 9.0.049e - January 2007

I never have any problem(s) with WaitWindowOpen on
a window name:

Example:

Let>WIN_USEHANDLE=0
WaitWindowOpen>Microsoft Excel*

However, when I use a window handle:

Let>WIN_USEHANDLE=1
WaitWindowOpen>WinHand1

no problem changing window focus back and forth to the
given window but the robot hangs when I attempt to
do the WaitWindowOpen ...

Is this the way it should be, have I missed something?
etc. Once again my apologies if this has been discussed
before.

Joel S.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Feb 25, 2007 3:16 pm

Window handles are assigned when the window is created. They therefore change from one session to the next. And if the window is created just before it is shown, then destroyed when it is closed then the handle will be different every time the window is opened. Therefore in most cases WaitWindowOpen with a handle will wait forever, since there is no way of knowing what the handle will be. You can't hard code a handle into the script as it cannot be determined. It is assigned by Windows when the window is created.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts