How to set the Window.Owner to Outlook window

前端 未结 2 446
青春惊慌失措
青春惊慌失措 2020-12-31 20:57

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?

2条回答
  •  一整个雨季
    2020-12-31 21:15

    This can be done via WindowInteropHelper:

    WindowInteropHelper wih = new WindowInteropHelper(yourWindow);
    wih.Owner = outlookHwnd;
    yourWindow.Show();
    

提交回复
热议问题