Export (0) Print
Expand All
ID
Top
Expand Minimize

ActiveWindow Property (General Extensibility)

Visual Studio .NET 2003

Returns the currently active window, or the top-most window if no others are active. Returns Nothing if no windows are open.

[Visual Basic .NET]
Public ReadOnly Property ActiveWindow() As Window
[Visual Basic 6]
Property Get ActiveWindow() As Window
[C++]
HRESULT __stdcall get_ActiveWindow(
   /* [out, retval] */ Window** retVal
);
[C#]
Window ActiveWindow {get;}
[JScript .NET]
public function get ActiveWindow() : Window

Return Value

Returns a Window Object object.

Remarks

  • For the DTE Object, ActiveWindow returns the environment's active window.
  • For the Document Object, ActiveWindow returns the document's active window.

You can set the caption only on Tool windows. If you attempt to set the caption on other window types, such as Document windows, you get the error, "Unspecified error."

Example

Sub ActiveDocumentExample()
   ' Create a new document before running this code.
   Dim objDoc As Document
   objDoc = DTE.ActiveDocument
   MsgBox(objDoc.ActiveWindow.Caption)
End Sub

See Also

Applies To: Document Object | DTE Object

Show:
© 2014 Microsoft