How to: Provide a Custom Properties Window
It is possible to provide your own Properties window for a given project system, instead of extending the Properties window provided by the Visual Studio integrated development environment (IDE). The most-often encountered scenario is when you yourself implement the object sited in the window frame.
In the event you do not implement the object sited in the window frame, but do still have access to it by some other means, there are a number of ways to access the IVsWindowFrame interface as listed in the last procedure on this page.
To provide your Properties window
Define a GUID that represents your Properties window implementation.
In your SetSite implementation, use the IProfferService service to proffer your Properties window as a service to the Visual Studio Environment.
To call your properties window
Call the SetSite method.
QueryService for SVsTrackSelectionEx from the IServiceProvider passed into the SetSite method.
Obtain IVsTrackSelectionEx from SVsTrackSelectionEx service.
Call OnElementValueChange with first parameter set to SEID_PropertyBrowserSID (taken from the VSConstants.VSSELELEMID enumeration), and the third parameter, varValue, representing a string form of the GUID that represents your Properties window. Make this call only once at the first creation of your Properties window document window. After the call this Properties window is associated with your window frame.
To obtain the Window Frame object when you are not the implementer
You can QueryService for SVsTrackSelectionEx service from GetProperty with the parameter propid set toVSFPROPID_SPFrame.
You can obtain the active document window by calling GetCurrentSelection through SVsMonitorSelection service. Set the parameter elementid toSEID_WindowFrame, taken from the VSConstants.VSSELELEMID enumeration.
See Also
Concepts
Properties Window Fields and Interfaces