Export (0) Print
Expand All
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
HRESULT __stdcall get_ActiveWindow(
   /* [out, retval] */ Window** retVal
Window ActiveWindow {get;}
[JScript .NET]
public function get ActiveWindow() : Window

Return Value

Returns a Window Object object.


  • 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."


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

See Also

Applies To: Document Object | DTE Object

© 2015 Microsoft