Files
docs-desktop/dotnet-desktop-guide/framework/wpf/app-development/how-to-get-all-windows-in-an-application.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

1.1 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Get all Windows in an Application 03/30/2017
csharp
vb
window objects [WPF], getting
f120f06e-993b-4a97-9657-af0d1986981f

How to: Get all Windows in an Application

This example shows how to get all xref:System.Windows.Window objects in an application.

Example

Every instantiated xref:System.Windows.Window object, whether visible or not, is automatically added to a collection of window references that is managed by xref:System.Windows.Application, and exposed from xref:System.Windows.Application.Windows%2A.

You can enumerate xref:System.Windows.Application.Windows%2A to get all instantiated windows using the following code:

[!code-csharpHOWTOWindowManagementSnippets#GetAllWindows] [!code-vbHOWTOWindowManagementSnippets#GetAllWindows]