WaitWindowChanged - What does it do?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
fightcancer
Macro Veteran
Posts: 247
Joined: Fri Apr 15, 2005 8:32 am

WaitWindowChanged - What does it do?

Post by fightcancer » Sun Jul 31, 2005 5:51 pm

I'm using WaitWindowChanged>5 to wait for a webpage to load. The webpage easily loads within that amount of time, however my next statement:

MessageModal>WWC_RESULT

always returns "FALSE". So WaitWindowChanged is useless for my purposes in this situation.

I don't think this command is doing what I think it's supposed to be doing. Can anyone help please?

thanks in advance,

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sun Jul 31, 2005 6:49 pm

WaitWindowChanged waits for a change in foreground window. It won't help you wait for a web page to load. Instead use VBScript and IE's busy function:
http://www.mjtnet.com/forum/viewtopic.php?t=1511
MJT Net Support
[email protected]

fightcancer
Macro Veteran
Posts: 247
Joined: Fri Apr 15, 2005 8:32 am

Post by fightcancer » Mon Aug 01, 2005 1:05 am

"foreground window"? I still don't understand what WaitWindowChanged does, but that script you linked to sure is beautiful!

THANKS!

IanSmith
Junior Coder
Posts: 24
Joined: Tue Jul 12, 2005 2:31 pm

Post by IanSmith » Tue Aug 02, 2005 10:42 am

WaitWindowChanged does not look at the contents of the window, but which window has focus. The Foreground window is the one with the dark blue title bar at the top (in a default colour scheme), and is the active window for all input.

Waitwindowchanged will return a true once the focus has been moved to another window.

I was trying a similar thing to you, until I realised what was happening...

Take care, Ian

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Aug 02, 2005 11:18 am

Foreground Window = The Active Window. The one in front of any other window and active. In front of. Hence Foreground.
MJT Net Support
[email protected]

fightcancer
Macro Veteran
Posts: 247
Joined: Fri Apr 15, 2005 8:32 am

Post by fightcancer » Thu Aug 11, 2005 10:26 am

support wrote:WaitWindowChanged waits for a change in foreground window. It won't help you wait for a web page to load. Instead use VBScript and IE's busy function:
http://www.mjtnet.com/forum/viewtopic.php?t=1511
Just a suggestion, it may be helpful for beginners to clarify that the WaitWindowChanged waits for a change in the foreground window "to another window". As is, a literal interpretation should include any change in the window including the blue loading bar at the bottom of a browser, the tiny visual effects of a button click, etc. Yet those changes don't trigger the WaitWindowChanged function.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Aug 11, 2005 10:38 am

One step ahead of you. The 7.4 help file says:

"This command causes Macro Scheduler to wait until the foreground window changes. I.e. the foreground window's title (caption) changes, or a different window becomes the foreground window. "
MJT Net Support
[email protected]

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