Share via


UiaAddEvent Function

Note  This function is deprecated. Client applications should use the Microsoft UI Automation COM interfaces instead.

Adds a listener for events on a node in the UI Automation tree.

Syntax

HRESULT UiaAddEvent(      
    HUIANODE hnode,
    EVENTID eventId,
    UiaEventCallback *pCallback,
    TreeScope *scope,
    PROPERTYID *pProperties,
    int cProperties,
    UiaCacheRequest *pRequest,
    HUIEVENT *phevent
);

Parameters

  • hnode
    [in] The node to add an event listener to.
  • eventId
    [in] The identifier of the event to listen for. For a list of event IDs, see Event Identifiers.
  • pCallback
    [in] The address of the application-defined UiaEventCallback callback function that is called when the event is raised.
  • scope
    [in] A value from the TreeScope enumerated type indicating the scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and children.
  • pProperties
    [in] The address of an array that contains the identifiers of the properties to monitor for change events, when eventId is the EVENTID derived from AutomationPropertyChanged_Event_GUID; otherwise this parameter is NULL. For a list of property IDs, see Property Identifiers.
  • cProperties
    [in] The count of elements in the pProperties array.
  • pRequest
    [in] The address of a UiaCacheRequest structure that defines the cache request in effect for nodes that are returned with events.
  • phevent
    [out] When this function returns, contains a pointer to the event that is added. This parameter is passed uninitialized.

Return Value

Returns S_OK if successful or an error value otherwise.

Function Information

Stock Implementation uiautomationcore.dll
Custom Implementation No
Header uiautomationcoreapi.h
Import library uiautomationcore.lib
Minimum operating systems Windows XP

See Also

UiaLookupId