IItemContainerProvider::FindItemByProperty Method
Retrieves an element within a containing element, based on a specified property value.
Syntax
HRESULT FindItemByProperty( IRawElementProviderSimple *pStartAfter, PROPERTYID propertyId, VARIANT value, IRawElementProviderSimple **pFound );
Parameters
- pStartAfter
[in] The address of the IRawElementProviderSimple inteface of the element after which the search begins, or NULL to search all elements.- propertyId
[in] The property identifier. For a list of property IDs, see Property Identifiers.- value
[in] A VARIANT that contains the value of the property.- pFound
[out] The address of a variable that receives a pointer to the IRawElementProviderSimple interface of the element.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
For virtual lists, the element returned may be a placeholder. IVirtualizedItemProvider::Realize can then be used to make the item fully available.
The method returns E_INVALIDARG if searching by the specified property is not supported. Most containers should support UIA_NamePropertyId and, if appropriate, UIA_AutomationIdPropertyId and UIA_SelectionItemIsSelectedPropertyId.
If propertyId is 0, all items are a match. This value can be used with pStartAfter equalling NULL to get the first item, and then to get successive items. In this case, value should be VT_EMPTY.
See Also