IUIAutomationDragPattern::GetCachedGrabbedItems method

Retrieves a cached collection of elements that represent the full set of items that the user is dragging as part of a drag operation.


HRESULT GetCachedGrabbedItems(
  IUIAutomationElementArray **retVal



Type: IAutomationElementArray**

The cached collection of elements that the user is dragging. This property is NULL or an empty array if only a single item is being dragged. The default value is an empty array.

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 item fires the appropriate events, to avoid having a large set of duplicate events. The client can query the GrabbedItems property to get the full list of grabbed items.


Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header uiautomationclient.h (include UIAutomation.h)

See Also