Compartilhar via


IVsTrackSelectionEx.OnSelectChangeEx Method

Definition

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

public:
 int OnSelectChangeEx(IntPtr pHier, System::UInt32 itemid, Microsoft::VisualStudio::Shell::Interop::IVsMultiItemSelect ^ pMIS, IntPtr pSC);
public int OnSelectChangeEx (IntPtr pHier, uint itemid, Microsoft.VisualStudio.Shell.Interop.IVsMultiItemSelect pMIS, IntPtr pSC);
abstract member OnSelectChangeEx : nativeint * uint32 * Microsoft.VisualStudio.Shell.Interop.IVsMultiItemSelect * nativeint -> int
Public Function OnSelectChangeEx (pHier As IntPtr, itemid As UInteger, pMIS As IVsMultiItemSelect, pSC As IntPtr) As Integer

Parameters

pHier
IntPtr

nativeint

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

itemid
UInt32

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

pMIS
IVsMultiItemSelect

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

pSC
IntPtr

nativeint

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

Returns

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

Remarks

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.

COM Signature

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.

Applies to