UiaRaiseNotificationEvent 函数 (uiautomationcoreapi.h)

由提供程序调用以启动通知事件。

语法

HRESULT UiaRaiseNotificationEvent(
  [in]           IRawElementProviderSimple *provider,
                 NotificationKind          notificationKind,
                 NotificationProcessing    notificationProcessing,
  [in, optional] BSTR                      displayString,
  [in]           BSTR                      activityId
);

参数

[in] provider

发生通知事件的提供程序节点。

notificationKind

通知的类型,作为 NotificationKind 枚举 值。

notificationProcessing

处理通知的首选方式,作为 NotificationProcessing 枚举 值。

[in, optional] displayString

通知消息中显示的字符串。

[in] activityId

用于标识操作或操作组的唯一非本地化字符串。 使用此函数将其他信息传递给事件处理程序。

返回值

如果此函数成功,则返回S_OK。 否则,它将返回 HRESULT 错误代码。

备注

如果窗口使用 WS_POPUP 样式,则它还必须实现窗口控件模式并处理WM_GETOBJECT消息 (请参阅如何公开 Server-Side UI 自动化 提供程序了解更多详细信息) 。

要求

要求
最低受支持的客户端 Windows 10版本 1709 [桌面应用 |UWP 应用]
最低受支持的服务器 Windows Server 2016 [桌面应用 |UWP 应用]
目标平台 Windows
标头 uiautomationcoreapi.h (包括 UIAutomation.h)
Library Uiautomationcore.lib
DLL Uiautomationcore.dll