I've implemented some new WPF stuff in a old WinForm app project and I used to run it as the following:
WpfWindow win = new WpfWindow(); // is a subclass of System.Windows.Window
System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(win);
WindowInteropHelper helper = new WindowInteropHelper(win);
helper.Owner = this.Handle;
win.Show();
now the question is, how can I get a list of opened Windows? In a native WPF project I simply do:
var windows = Application.Current.Windows
but I did not find any way in a form project.
Before you show the first Window, for example in startup of your application, create an instance of System.Windows.Application (and forget it).
Later, in your WinForms application, you can easily find all WPF windows:
Note:
Do this only once, for example in startup of the application. Look at source code of the application class.
It's pretty similar to the way that a WPF app does it: