GetWindowList gets wrong window - Shift+Esc to Stop

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

GetWindowList gets wrong window - Shift+Esc to Stop

Post by gdyvig » Fri Dec 05, 2008 7:34 pm

This problem is new to MS v11.

Here is the code:

//Get list of visible windows
Let>WF_TYPE=2
GetWindowList>VisibleWinlist
MessageModal>%VisibleWinlist%

Here is the MessageModal result:
Shift+Esc to Stop
(rest of windows)

Here is the problem: "Shift+Esc to Stop" is not a visible window.

Both v10 and v11 versions of View System Windows report this window:
65988 - TfrmMacroScript "Shift+Esc to Stop"

This broke my macro that closes all visible windows.

Gale

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

Post by Marcus Tettmar » Fri Dec 05, 2008 8:15 pm

I think it is now visible - just sized to 0x0 (it must be visible - msched is just calling win32 functions to determine whether the window is visible or not - and they tend not to lie). Arguably the command should ignore it anyway.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

What can be done with this window

Post by gdyvig » Fri Dec 05, 2008 9:46 pm

What can/should we do with this window?
Can it be closed or minimized?
Will it interfere with GetActiveWindow?
Try to skip over it?

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

Post by Marcus Tettmar » Fri Dec 05, 2008 9:52 pm

I would just ignore it. Trying to close it won't do anything anyway. This does no harm:

CloseWindow>Shift+Esc To Stop

Just wondering - why/how is this breaking your existing script?

But I think internally it should just be ignored - any windows owned by msched should probably be ignored.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Handling windows found by GetWindowList

Post by gdyvig » Fri Dec 05, 2008 10:08 pm

I'm trying to get back to a known state in my application by closing any windows that happen to be open until I get to a target window, usually the application's main window.

I was having trouble with GetActiveWindow and CloseWindow but found that GetWindowList and taking action on the first window in the list worked for v10. My app has a window that can't be closed, but minimizing it gets it off the list. With this new window at the top of the list, I would need to take action on the second window in the list.

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

Post by Marcus Tettmar » Fri Dec 05, 2008 10:41 pm

I'll try and get this fixed - either by finding out why that window is now not hidden and hide it again or by ignoring it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Thank you

Post by gdyvig » Sat Dec 06, 2008 9:56 pm

Thanks for checking this out.

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Shift+Esc To Stop fix confirmed

Post by gdyvig » Mon Dec 08, 2008 6:53 pm

I just tried out the lastest v11 update (build31) and confirmed the "Shift+Esc To Stop" fix works. Now the GetWindowList function behaves like it did in v10.

Thanks for the quick response!

Gale

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