Windows.CreateToolWindow Method
Creates a new tool window containing the specified Document object or ActiveX control.
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
Function CreateToolWindow ( _
AddInInst As AddIn, _
ProgID As String, _
Caption As String, _
GuidPosition As String, _
<OutAttribute> ByRef DocObj As Object _
) As Window
'Usage
Dim instance As Windows
Dim AddInInst As AddIn
Dim ProgID As String
Dim Caption As String
Dim GuidPosition As String
Dim DocObj As Object
Dim returnValue As Window
returnValue = instance.CreateToolWindow(AddInInst, _
ProgID, Caption, GuidPosition, DocObj)
Window CreateToolWindow(
AddIn AddInInst,
string ProgID,
string Caption,
string GuidPosition,
out Object DocObj
)
Window^ CreateToolWindow(
[InAttribute] AddIn^ AddInInst,
[InAttribute] String^ ProgID,
[InAttribute] String^ Caption,
[InAttribute] String^ GuidPosition,
[InAttribute] [OutAttribute] Object^% DocObj
)
function CreateToolWindow(
AddInInst : AddIn,
ProgID : String,
Caption : String,
GuidPosition : String,
DocObj : Object
) : Window
Parameters
AddInInst
Type: EnvDTE.AddInRequired. An AddIn object whose lifetime determines the lifetime of the tool window.
ProgID
Type: System.StringRequired. The programmatic ID of the Document object or ActiveX control.
Caption
Type: System.StringRequired. The caption for the new tool window.
GuidPosition
Type: System.StringRequired. A unique identifier for the new tool window, which can be used as an index to Item.
DocObj
Type: System.Object%Required. The Document object or control to be hosted in the tool window.
Return Value
Type: EnvDTE.Window
A Window object.
Remarks
If you attempt to set any of the visibility states of the new tool window — such as height, width, or position — before the tool window is visible, you get an error. Therefore, make sure that the window is visible before attempting to set any such properties.
For an example of how to use this method, see the ToolWindow sample on the Visual Studio Automation Samples webpage. For information about creating ActiveX controls, see Creating an MFC ActiveX Control.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.