Share via


IUIAutomation::AddPropertyChangedEventHandlerNativeArray Method

Registers a method that handles property-changed events.

Syntax

HRESULT AddPropertyChangedEventHandlerNativeArray(      
    IUIAutomationElement *element,
    TreeScope scope,
    IUIAutomationCacheRequest *cacheRequest,
    IUIAutomationPropertyChangedEventHandler *handler,
    PROPERTYID *propertyArray,
    int propertyCount
);

Parameters

  • element
    [in] The address of the IUIAutomationElement interface of the UI Automation element interface with which to associate the event handler.
  • scope
    [in] A value from the TreeScope enumerated type specifying the scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and children.
  • cacheRequest
    [in] The address of the IUIAutomationCacheRequest interface of a cache request, or NULL if no caching is wanted.
  • handler
    [in] The address of the IUIAutomationPropertyChangedEventHandler interface of the object that handles the event.
  • propertyArray
    [in] The address of an array containing the identifiers of the Microsoft UI Automation properties of interest. For a list of property IDs, see Property Identifiers.
  • propertyCount
    [in] The number of elements in propertyArray.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

The UI item specified by element might not support the properties specified by the propertyArray parameter.

This method serves the same purpose as IUIAutomation::AddPropertyChangedEventHandler, but takes a normal array of property identifiers instead of a SAFEARRAY.

A UI Automation client should not use multiple threads to add or remove event handlers. Unexpected behavior can result if one event handler is being added or removed while another is being added or removed in the same client process.

See Also

IUIAutomation::AddPropertyChangedEventHandler, IUIAutomation::RemovePropertyChangedEventHandler, IUIAutomation::RemoveAllEventHandlers, Caching UI Automation Properties and Control Patterns, UI Automation Events for Clients