Partager via


IVsTrackSelectionEx.OnSelectChangeEx Method

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)

Syntax

'Declaration
Function OnSelectChangeEx ( _
    pHier As IntPtr, _
    itemid As UInteger, _
    pMIS As IVsMultiItemSelect, _
    pSC As IntPtr _
) As Integer
int OnSelectChangeEx(
    IntPtr pHier,
    uint itemid,
    IVsMultiItemSelect pMIS,
    IntPtr pSC
)
int OnSelectChangeEx(
    [InAttribute] IntPtr pHier, 
    [InAttribute] unsigned int itemid, 
    [InAttribute] IVsMultiItemSelect^ pMIS, 
    [InAttribute] IntPtr pSC
)
abstract OnSelectChangeEx : 
        pHier:IntPtr * 
        itemid:uint32 * 
        pMIS:IVsMultiItemSelect * 
        pSC:IntPtr -> int
function OnSelectChangeEx(
    pHier : IntPtr, 
    itemid : uint, 
    pMIS : IVsMultiItemSelect, 
    pSC : IntPtr
) : int

Parameters

  • pHier
    Type: IntPtr

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

  • itemid
    Type: UInt32

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

  • pSC
    Type: IntPtr

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

Return Value

Type: Int32
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 nulla null reference (Nothing in Visual Basic) 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 nulla null reference (Nothing in Visual Basic).

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.

.NET Framework Security

See Also

Reference

IVsTrackSelectionEx Interface

Microsoft.VisualStudio.Shell.Interop Namespace