Crates.io | winrt-toast-reborn |
lib.rs | winrt-toast-reborn |
version | 0.2.1 |
source | src |
created_at | 2024-05-30 15:26:03.276815 |
updated_at | 2024-05-31 05:32:53.213352 |
description | A toast notification library for Windows 10 and 11. |
homepage | |
repository | https://github.com/AtifChy/winrt-toast.git |
max_upload_size | |
id | 1256982 |
size | 60,709 |
A mostly usable binding to the Windows ToastNotification
API.
use winrt_toast::{Toast, Text, Header, ToastManager};
use winrt_toast::content::text::TextPlacement;
fn main() {
let manager = ToastManager::new(ToastManager::POWERSHELL_AUM_ID);
let mut toast = Toast::new();
toast
.text1("Title")
.text2(Text::new("Body"))
.text3(
Text::new("Via SMS")
.with_placement(TextPlacement::Attribution)
);
manager.show(&toast).expect("Failed to show toast");
}