다음을 통해 공유


IVsTrackSelectionEx.GetCurrentSelection Method

Definition

Returns the current selection.

public:
 int GetCurrentSelection([Runtime::InteropServices::Out] IntPtr % ppHier, [Runtime::InteropServices::Out] System::UInt32 % pitemid, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsMultiItemSelect ^ % ppMIS, [Runtime::InteropServices::Out] IntPtr % ppSC);
public int GetCurrentSelection (out IntPtr ppHier, out uint pitemid, out Microsoft.VisualStudio.Shell.Interop.IVsMultiItemSelect ppMIS, out IntPtr ppSC);
abstract member GetCurrentSelection : nativeint * uint32 * IVsMultiItemSelect * nativeint -> int
Public Function GetCurrentSelection (ByRef ppHier As IntPtr, ByRef pitemid As UInteger, ByRef ppMIS As IVsMultiItemSelect, ByRef ppSC As IntPtr) As Integer

Parameters

ppHier
IntPtr

nativeint

[out] Pointer to a pointer to the IVsHierarchy interface of the current selection.

pitemid
UInt32

[out] Pointer to the item identifier of the current selection. For a list of valid pitemid values, see VSITEMID.

ppMIS
IVsMultiItemSelect

[out] Pointer to a pointer to the IVsMultiItemSelect interface of the window containing the current selection.

ppSC
IntPtr

nativeint

[out] Pointer to a pointer to the ISelectionContainer interface of the current selection.

Returns

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.

Applies to