获取所有 Windows 8/10 toast 通知

Get all Windows 8/10 toast notifications

是否可以在其他应用引发 Windows 8/10 toast 通知时收到通知并获取这些 toast 的内容?或者,有没有办法获取所有当前通知,以便我可以轮询此列表以添加内容?

WinRT 的 Windows.UI.Notifications.ToastNotificationManager 有一个 CreateToastNotifier method which can take an application id and returns a ToastNotifier bound to a specific app. Theoretically, it seems that creating a ToastNotifier for each running app (if this is not prevented for security reasons) and calling GetScheduledToastNotifications 周期性地可以得到计划的通知,但不是其他类型的通知。

似乎没有一个容易找到的 API。使用 Windows 10 的新通知中心,是否有任何新的方式来访问通知?

在当前操作系统(Windows 8、8.1,Windows Phone 8.1)上没有支持的方法来执行此操作。应用只能看到自己的通知。

CreateToastNotifier 仅适用于调用包中的应用程序。不能为任意其他应用程序调用它。 Windows Phone 8.1 的 Action Center API 同样仅限于当前应用(参见 Managing toast notifications in action center

关于 Windows 10 具体 API 的信息尚未公布。