Get all Windows in a WPF Application

The Windows property of an Application represents all Window instances in an Application.

The following code snippet gets all windows and reads their titles.

foreach( Window window in Application.Current.Windows ) 
{
string str = window.Title;
}