IVsMultiItemSelect::GetSelectedItems Method (UInt32, UInt32, array<VSITEMSELECTION>^)

 

Returns an IVsHierarchy interface pointer and item identifier for selected items.

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

int GetSelectedItems(
	unsigned int grfGSI,
	unsigned int cItems,
	array<VSITEMSELECTION>^ rgItemSel
)

Parameters

grfGSI
Type: System::UInt32

[in] Flag providing information about how the selected items should be returned. For valid grfGSI values, see __VSGSIFLAGS.

cItems
Type: System::UInt32

[in] Number of items that are selected.

rgItemSel
Type: array<Microsoft.VisualStudio.Shell.Interop::VSITEMSELECTION>^

[out, size_is(cItems)] Array of VSITEMSELECTION structures which contain an IVsHierarchy pointer and item identifier for each selected item.

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 IVsMultiItemSelect::GetSelectedItems(
   [in] VSGSIFLAGS grfGSI,
   [in] ULONG cItems,
   [out, size_is(cItems)] VSITEMSELECTION rgItemSel[]
);

If all selected items belong to a single hierarchy, set the pHier member of each VSITEMSELECTION structure to point to the IVsHierarchy interface for that hierarchy. Set the itemid member of each structure to VSITEMID_SELECTION.

If the selected items belong to multiple hierarchies, set the pHier member of each VSITEMSELECTION structure to point to the first common IVsHierarchy interface, typically the parent hierarchy. Set the itemid member of each structure to VSITEMID_SELECTION.

The information retrieved from GetSelectedItems can be used to update the Solution Explorer.

Return to top
Show: