UiaAddEvent function

Note  This function is deprecated. Client applications should use the Microsoft UI Automation Component Object Model (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,
  HUIAEVENT        *phEvent
);

Parameters

hnode

Type: HUIANODE

The node to add an event listener to.

eventId

Type: EVENTID

The identifier of the event to listen for. For a list of event IDs, see Event Identifiers.

pCallback

Type: UiaEventCallback*

The address of the application-defined UiaEventCallback callback function that is called when the event is raised.

scope

Type: TreeScope*

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

Type: PROPERTYID*

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

Type: int

The count of elements in the pProperties array.

pRequest

Type: UiaCacheRequest*

The address of a UiaCacheRequest structure that defines the cache request in effect for nodes that are returned with events.

phEvent

Type: HUIEVENT*

When this function returns, contains a pointer to the event that is added. This parameter is passed uninitialized.

Return Value

Type: HRESULT

Returns S_OK if successful or an error value otherwise.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header uiautomationcoreapi.h
Library Uiautomationcore.lib
DLL Uiautomationcore.dll

See Also

UiaLookupId