A read-only property that returns a Boolean value that indicates whether the window associated with the Window object is the active window.
expression.Active
expression Required. An expression that returns a reference to the Window object.
0: Can be accessed without restrictions.
To designate a window as the active window, use the Activate method of the Window object.
In the following example, the Active property of the Window object is used to determine whether the first window contained in the Windows collection is the active window:
if (Application.Windows(0).Active)
{
XDocument.UI.Alert("The window is active.");
}