I have an outlook plugin which pops up a WPF window
Is there a way to set the WPF’s Window.Owner property to Outlook?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Kudos to @reedcopsey for putting us on the right track…
The trick for retrieving the Outlook Handle is using reflection to obtain the active window’s title (Caption) and the
FindWindowWin32 API to obtain the active windowIntPtrhandle (inspector, explorer, etc.). Inspired from this MSDN forum post. Once you have the active window handle, you can leverageWindowInteropHelperfor managing the owner relationship.Retrieving Outlook Handle (via
ActiveWindow)OfficeWin32Window (Helper Class)