HTMLWindow.DTE Property

Gets the top-level extensibility object.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
ReadOnly Property DTE As DTE
'Usage
Dim instance As HTMLWindow 
Dim value As DTE 

value = instance.DTE
DTE DTE { get; }
property DTE^ DTE {
    DTE^ get ();
}
function get DTE () : DTE

Property Value

Type: EnvDTE.DTE
A DTE object.

Remarks

In Visual Studio, the DTE object is the root of the automation model, which other object models often call "Application."

Examples

public void CodeExample(DTE2 dte, AddIn addin)
{
   // Make sure you have an open HTML document before running this example
    try
    {
        if (dte.ActiveDocument.ActiveWindow.Object is HTMLWindow)
        {
            HTMLWindow htmlwin;
            string msg = "";
            htmlwin = dte.ActiveDocument.ActiveWindow.Object as HTMLWindow;
            // Show the related application object's name.
            msg += "The application containing this HTMLWindow is " + htmlwin.DTE.Name;
            // Show the HTMLWindow's parent object.
            msg += "\nThe HTMLWindow's parent object is " + htmlwin.Parent.Type.ToString();
            MessageBox.Show(msg);
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework Security

See Also

Reference

HTMLWindow Interface

HTMLWindow Members

EnvDTE Namespace

Other Resources

How to: Compile and Run the Automation Object Model Code Examples