FindWindow with a Partially Famous Name

Outlook example: its only process, but can have several windows (the user can double-click on an email to open it in his window)

So, I cannot use Process.GetProcess () to iterate processes and compare names.

FindWindow () requires the full name; I know the name, but the Outlook window adds it at the end, i.e. - Message (Rich Text) or - Message (HTML), etc.

Is it possible to get all mail windows (pens) for Outlook? then iterate over them to find my window using GetWindowText () ? Any pointers would be much appreciated.

+7
source share
1 answer

You can use EnumWindow to list all the windows found by the ones you want.

http://www.pinvoke.net/default.aspx/user32.enumwindows

+10
source

All Articles