WindowClosedEventArgs Class

Contains information about the event that is raised when a window is closed.

Namespace: System.Windows.Automation
Assembly: UIAutomationTypes (in uiautomationtypes.dll)
XML Namespace:

public sealed class WindowClosedEventArgs : AutomationEventArgs
public final class WindowClosedEventArgs extends AutomationEventArgs
public final class WindowClosedEventArgs extends AutomationEventArgs
Not applicable.

To subscribe to window-closed events, call AddAutomationEventHandler, specifying WindowClosedEvent in the eventId parameter and supplying an UI Automation event handler that takes a WindowClosedEventArgs parameter.

When your application receives a window-closed event, the sender parameter of the event handler cannot be used to obtain information about the window that has closed, because the corresponding UI Automation element is no longer valid.

For example code, see GetRuntimeId.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0