Reputation: 1483
Example Outlook: its only one process but can have multiple windows (user can double click on the email to open it in its own window)
So, I cannot use Process.GetProcess() to iterate through the processes and compare title.
FindWindow() needs full title; I know the title but Outlook window adds its own in the end i.e. - Message (Rich Text) or - Message (HTML) .. etc.
Can I get all the email windows (handles) for Outlook ? then iterate over those to find my window using GetWindowText() ? Any pointers will be highly appreciated.
Upvotes: 8
Views: 10757
Reputation: 10431
You can use EnumWindow to enumerate through all the windows finding the one you want.
http://www.pinvoke.net/default.aspx/user32.enumwindows
Upvotes: 11