IUIAutomation::AddPropertyChangedEventHandlerNativeArray Method

Registers a method that handles property-changed events.


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


[in] The address of the IUIAutomationElement interface of the UI Automation element interface with which to associate the event handler.
[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.
[in] The address of the IUIAutomationCacheRequest interface of a cache request, or NULL if no caching is wanted.
[in] The address of the IUIAutomationPropertyChangedEventHandler interface of the object that handles the event.
[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.
[in] The number of elements in propertyArray.

Return Value

Returns S_OK if successful, or an error value otherwise.


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

Community Additions