IUIAutomationEventHandlerGroup::AddNotificationEventHandler 方法 (uiautomationclient.h)

注册处理通知事件的方法。

重要Microsoft UI 自动化客户端应使用处理程序组方法来注册事件侦听器,而不是各种 IUIAutomation 命名空间中定义的单个事件注册方法。
 

语法

HRESULT AddNotificationEventHandler(
       TreeScope                             scope,
  [in] IUIAutomationCacheRequest             *cacheRequest,
  [in] IUIAutomationNotificationEventHandler *handler
);

参数

scope

[in] cacheRequest

指向缓存请求的指针;如果不需要缓存,则为 NULL

[in] handler

指向处理通知事件的 对象的指针。

返回值

如果该方法成功,则返回 S_OK。 否则,将返回 HRESULT 错误代码。

注解

在实现事件处理程序之前,应熟悉了解线程处理问题中所述 的线程问题

要求

要求
最低受支持的客户端 Windows 10 版本 1809 [仅限桌面应用]
最低受支持的服务器 Windows Server 版本 1709 [仅限桌面应用]
目标平台 Windows
标头 uiautomationclient.h (包括 UIAutomation.h)

另请参阅

IUIAutomationEventHandlerGroup