IUIAutomation5::AddNotificationEventHandler method

Registers a method that handles notification events.

Note  Before implementing an event handler, you should be familiar with the threading issues described in Understanding Threading Issues.
 

Syntax

HRESULT AddNotificationEventHandler(
  IUIAutomationElement                  *element,
  TreeScope scope                       ,
  IUIAutomationCacheRequest             *cacheRequest,
  IUIAutomationNotificationEventHandler *handler
);

Parameters

element

Type: IUIAutomationElement*

A pointer to the UI Automation element associated with the event handler.

arg2

Type: TreeScope

The scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and descendants.

cacheRequest

Type: IUIAutomationCacheRequest*

A pointer to a cache request, or NULL if no caching is wanted.

handler

Type: IUIAutomationNotificationEventHandler*

A pointer to the object that handles the notification event.

Return Value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

   
Minimum supported client Windows 10, version 1709 [desktop apps only]
Minimum supported server Windows Server, version 1709 [desktop apps only]
Target Platform Windows
Header uiautomationclient.h (include UIAutomation.h)

See Also

IUIAutomation5

RemoveAllEventHandlers