How to SetFocus Two Windows with an Identical Title

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

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

Post by Marcus Tettmar » Mon Apr 21, 2008 12:24 pm

hwndChildAfter
[in] Handle to a child window. The search begins with the next child window in the Z order. The child window must be a direct child window of hwndParent, not just a descendant window.

If hwndChildAfter is NULL, the search begins with the first child window of hwndParent.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Wed Dec 31, 2008 12:12 am

Now I revisit the topic due to multiple instances of Outlook 2007.
From Tools > View System Windows, I can see:
1246018 - rctrl_renwnd32 "Calendar - Microsoft Outlook"

But the technique of LibFunc>User32,FindWindowA,h1,a.b.a.d,Calendar - Microsoft Outlook taught by Marcus fails in this case.

Outlook is complicated because the window title could be changed to Task or any mail folder.

Question:
1. How to identify a proper Window Handle connecting to the Outlook 2007?
2, How to SetFocus to the Window Handle?

Thanks a lot for your help in advance.

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