Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IDragProvider::GetGrabbedItems method

Retrieves the collection of elements that are being dragged as part of a drag operation.


HRESULT GetGrabbedItems(
  [out, retval, optional] SAFEARRAY **pRetVal


pRetVal [out, retval, optional]

An array of VT_UNKNOWN pointers to the IRawElementProviderSimple interfaces of the elements that are being dragged. This parameter is NULL if only a single item is being dragged.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


If the user is dragging multiple items, the items are represented by a single master element with an associated set of grabbed elements. The master element raises the appropriate events, to avoid having a large set of duplicate events. The client can call GetGrabbedItems to retrieve the full list of grabbed items. The provider should allocate a SAFEARRAY of appropriate length and add the Component Object Model (COM) pointers of the elements that are part of the drag operation.


Minimum supported client

Windows 8 [desktop apps | UWP apps]

Minimum supported server

Windows Server 2012 [desktop apps | UWP apps]


UIAutomationCore.h (include UIAutomation.h)



See also




© 2018 Microsoft