Freigeben über


IVsTrackSelectionEx.GetCurrentSelection Method

Returns the current selection.

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

Syntax

'Declaration
Function GetCurrentSelection ( _
    <OutAttribute> ByRef ppHier As IntPtr, _
    <OutAttribute> ByRef pitemid As UInteger, _
    <OutAttribute> ByRef ppMIS As IVsMultiItemSelect, _
    <OutAttribute> ByRef ppSC As IntPtr _
) As Integer
'Usage
Dim instance As IVsTrackSelectionEx
Dim ppHier As IntPtr
Dim pitemid As UInteger
Dim ppMIS As IVsMultiItemSelect
Dim ppSC As IntPtr
Dim returnValue As Integer

returnValue = instance.GetCurrentSelection(ppHier, _
    pitemid, ppMIS, ppSC)
int GetCurrentSelection(
    out IntPtr ppHier,
    out uint pitemid,
    out IVsMultiItemSelect ppMIS,
    out IntPtr ppSC
)
int GetCurrentSelection(
    [OutAttribute] IntPtr% ppHier, 
    [OutAttribute] unsigned int% pitemid, 
    [OutAttribute] IVsMultiItemSelect^% ppMIS, 
    [OutAttribute] IntPtr% ppSC
)
abstract GetCurrentSelection : 
        ppHier:IntPtr byref * 
        pitemid:uint32 byref * 
        ppMIS:IVsMultiItemSelect byref * 
        ppSC:IntPtr byref -> int 
function GetCurrentSelection(
    ppHier : IntPtr, 
    pitemid : uint, 
    ppMIS : IVsMultiItemSelect, 
    ppSC : IntPtr
) : int

Parameters

  • pitemid
    Type: System.UInt32%
    [out] Pointer to the item identifier of the current selection. For a list of valid pitemid values, see VSITEMID.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsTrackSelectionEx::GetCurrentSelection(
   [out] IVsHierarchy ** ppHier,
   [out] VSITEMID * pitemid,
   [out] IVsMultiItemSelect ** ppMIS,
   [out] ISelectionContainer **ppSC
);

If the content of the pitemid parameter is VSITEMID_SELECTION, which indicates indicate a selection made up of multiple items, retrieve the selected items with GetSelectedItems using the interface pointed to by ppMIS.

.NET Framework Security

See Also

Reference

IVsTrackSelectionEx Interface

IVsTrackSelectionEx Members

Microsoft.VisualStudio.Shell.Interop Namespace