IVsMultiItemSelect.GetSelectedItems(UInt32, UInt32, VSITEMSELECTION[]) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns an IVsHierarchy interface pointer and item identifier for selected items.
public:
int GetSelectedItems(System::UInt32 grfGSI, System::UInt32 cItems, cli::array <Microsoft::VisualStudio::Shell::Interop::VSITEMSELECTION> ^ rgItemSel);
int GetSelectedItems(unsigned int grfGSI, unsigned int cItems, std::Array <Microsoft::VisualStudio::Shell::Interop::VSITEMSELECTION> const & rgItemSel);
public int GetSelectedItems (uint grfGSI, uint cItems, Microsoft.VisualStudio.Shell.Interop.VSITEMSELECTION[] rgItemSel);
abstract member GetSelectedItems : uint32 * uint32 * Microsoft.VisualStudio.Shell.Interop.VSITEMSELECTION[] -> int
Public Function GetSelectedItems (grfGSI As UInteger, cItems As UInteger, rgItemSel As VSITEMSELECTION()) As Integer
Parameters
- grfGSI
- UInt32
[in] Flag providing information about how the selected items should be returned. For valid grfGSI
values, see __VSGSIFLAGS.
- cItems
- UInt32
[in] Number of items that are selected.
- rgItemSel
- VSITEMSELECTION[]
[out, size_is(cItems)] Array of VSITEMSELECTION structures which contain an IVsHierarchy pointer and item identifier for each selected item.
Returns
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
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.