How to: Provide automation for windows
You can provide automation for document and tool windows. Providing automation is advisable whenever you want to make automation objects available on a window, and the environment does not already provide a ready-made automation object, as it does with a task list.
Automation for tool windows
The environment provides automation on a tool window by returning a standard Window object as explained in the following procedure:
When a caller requests a VSPackage-specific automation object for your tool window through Object, the environment calls
IExtensibleObject, IVsExtensibleObject, or the
IVsExtensibleObjectprovide a GetAutomationObject method.
When the environment then calls the
NULL, respond by passing back your VSPackage-specific object.
IVsExtensibleObjectfails, then the environment calls
Automation for document windows
A standard Document object is also available from the environment, although an editor can have its own implementation of the Document object by implementing
IExtensibleObject interface and responding to
In addition, an editor can provide a VSPackage-specific automation object, retrieved through the Object method, by implementing the
IExtensibleObject interfaces. The VSSDK samples contributes an RTF document-specific automation object.