IVsTrackSelectionEx::OnSelectChangeEx Method (IntPtr, UInt32, IVsMultiItemSelect^, IntPtr)

 

Informs the environment that a change in the current selection has occurred.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

int OnSelectChangeEx(
	IntPtr pHier,
	unsigned int itemid,
	IVsMultiItemSelect^ pMIS,
	IntPtr pSC
)

Parameters

pHier
Type: System::IntPtr

[in] Pointer to the IVsHierarchy interface of the new selection.

itemid
Type: System::UInt32

[in] Identifier of the project item of the new selection. For a list of valid itemid values, see VSITEMID.

pMIS
Type: Microsoft.VisualStudio.Shell.Interop::IVsMultiItemSelect^

[in] Pointer to the IVsMultiItemSelect interface of the window containing the new selection.

pSC
Type: System::IntPtr

[in] Pointer to the ISelectionContainer interface of the window containing the new selection.

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

If a selected item does not have a selection container or its selection container should not become active when its owner is activated, you substitute an IntPtr version of SELCONTAINER_DONTPROPAGATE or SELCONTAINER_DONTCHANGE for pSC. If the hierarchy of the selection should not become actively-selected or there is no hierarchy element, you substitute an IntPtr version of HIERARCHY_DONTPROPAGATE or HIERARCHY_DONTCHANGE for pHier.

If the value is SELCONTAINER_DONTCHANGE, the selection container that was in the global selection from some other activated object will remain when the owning object is activated. If the value is SELCONTAINER_DONTPROPAGATE, the selection container in the global selection is set to null when the owning object is activated. The hierarchy values are similar: use HIERARCHY_DONTCHANGE if the hierarchy should not be the actively-selected hierarchy when the owning object is selected, or HIERARCHY_DONTPROPAGATE if the hierarchy should be null.

From vsshell.idl:

HRESULT IVsTrackSelectionEx::OnSelectChangeEx(
   [in] IVsHierarchy *pHier,
   [in] VSITEMID itemid,
   [in] IVsMultiItemSelect *pMIS,
   [in] ISelectionContainer *pSC
);

Project-type windows call OnSelectChangeEx to alert the environment to a change in the active window and the current selection. The environment uses the pHier and itemid parameters to update the Solution Explorer window if necessary. The pMIS parameter provides access to a multiple selection and the pSC parameter provides access to a single selection.

Return to top
Show: