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

 

Returns the current selection.

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

int GetCurrentSelection(
	[OutAttribute] IntPtr% ppHier,
	[OutAttribute] unsigned int% pitemid,
	[OutAttribute] IVsMultiItemSelect^% ppMIS,
	[OutAttribute] IntPtr% ppSC
)

Parameters

ppHier
Type: System::IntPtr

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

pitemid
Type: System::UInt32

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

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

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

ppSC
Type: System::IntPtr

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

Return Value

Type: System::Int32

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

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.

Return to top
Show: