Reputation: 1601
I want to get all opened windows (WPF) and forms (WF) of my Mixed-application.
There is a method called Application.Current.Windows
... but its only returning the WPF Windows.
Note: The Windows Forms are stored in an other project (DLL) in the solution.
Upvotes: 0
Views: 2421
Reputation: 6857
For this you have to use
foreach (Window win in System.Windows.Application.Current.Windows)
{
win..title;
}
Upvotes: 0
Reputation: 84745
You can access Windows Forms' open forms via the System.Windows.Forms.Application.OpenForms
static property. The property is contained in the System.Windows.Forms.dll
assembly, so you will need a reference to it.
(IIRC, this property only returns the forms that were created on the current thread; therefore, if you have two separate UI threads (one for Windows Forms, one for WPF), I believe you need to call the property on Windows Forms' UI thread.)
Upvotes: 2
Reputation: 274
Check this msdn Hope you find what your looking for. it also has example.
Upvotes: 0