What's the difference between WaitWindowFocused and WaitWindowOpen + SetFocus?
I notice that WaitWindowFocused does not function like SetFocus.
Why WaitWindowFocused?
Moderators: JRL, Dorian (MJT support)
That was my request so I suppose it should be up to me to explain
I often have a window already open but I'm waiting for a process to complete before that window is available for more user-like activity. I think that WaitWindowFocused will help solve that situation.
Read the original request here.

I often have a window already open but I'm waiting for a process to complete before that window is available for more user-like activity. I think that WaitWindowFocused will help solve that situation.
Read the original request here.
Thanks for identifying yourself as the inventor of the newly born function.
The online help defeats normal users' understanding, including myself.
Your original post helps unmask the mystery.
It turns out that the WaitWindowFocused was conceived based upon several assumptions:
1. The window in question is already active in the background.
2. The window in question is currently busy.
3. The window in question is not yet a foreground window.
4. The window in quesiton will become a foreground window after completing its current task.
No wonder WaitWindowFocused is not related to WaitWindowOpen and SetFocus.
JRL, thanks for your help.
The online help defeats normal users' understanding, including myself.
Your original post helps unmask the mystery.
It turns out that the WaitWindowFocused was conceived based upon several assumptions:
1. The window in question is already active in the background.
2. The window in question is currently busy.
3. The window in question is not yet a foreground window.
4. The window in quesiton will become a foreground window after completing its current task.
No wonder WaitWindowFocused is not related to WaitWindowOpen and SetFocus.
JRL, thanks for your help.
Code: Select all
Label>WaitForUpdatingWO
GetActiveWindow>WinTitle,WinX,WinY
Separate>WinTitle,Updating WO:,WaitUWOres
If>WaitUWOres_Count>1
Else
Wait>0.5
Goto>WaitForUpdatingWO
EndIf
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Armsys,
The help file is accurate. It doesn't know or care if the window is busy and the window doesn't have to be in the background.
It simply waits until the specified window both EXISTS and is FOCUSED. If the specified window exists and is the active window it will return.
The manual says:
"Waits for a specified window to open/appear and be focused (the foreground window). "
Is that really so confusing as to "defeat understanding"?
When opening a new window it will usually become the active window, so in that case, in most cases, WaitWindowOpen is enough. But what if the window in question may already exist and you want to wait until it is the active window? You want to know that it exists and is active. That's what WaitWindowFocused will do.
The help file is accurate. It doesn't know or care if the window is busy and the window doesn't have to be in the background.
It simply waits until the specified window both EXISTS and is FOCUSED. If the specified window exists and is the active window it will return.
The manual says:
"Waits for a specified window to open/appear and be focused (the foreground window). "
Is that really so confusing as to "defeat understanding"?
When opening a new window it will usually become the active window, so in that case, in most cases, WaitWindowOpen is enough. But what if the window in question may already exist and you want to wait until it is the active window? You want to know that it exists and is active. That's what WaitWindowFocused will do.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Hi Marcus,
After testing with scripts, I found the WaitWindowFocusd has neither functonality.
Actually, there's one BIG if: The windows (process) in question suddenly, mysteriously, automatically transits from background to foreground unaided by SetFocus.
Otherwise, WW_RESULT for WaitWindowFocused is always "FALSE".
Word rarely fits into the above scenario whereby WaitWindowFocused can yield a more desirable outcome.
That's exactly the genesis of the confusion. In the absence of JRL's background tale, I would be impressed that WaitWindowFocus is a combination of: WaitWindowOpen + SetFocus.Marcus Tettmar wrote:The manual says:
"Waits for a specified window to open/appear and be focused (the foreground window). "
After testing with scripts, I found the WaitWindowFocusd has neither functonality.
Actually, there's one BIG if: The windows (process) in question suddenly, mysteriously, automatically transits from background to foreground unaided by SetFocus.
Otherwise, WW_RESULT for WaitWindowFocused is always "FALSE".
Word rarely fits into the above scenario whereby WaitWindowFocused can yield a more desirable outcome.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Let me be totally candid and say that I find it hard to follow your form of English. So perhaps we just struggle to understand each other. I don't follow your last post, and I still think the way it has been explained in the help file is precise.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?