reuse_toast/reuse_toast.rs
1extern crate winrt_notification;
2use winrt_notification::{Duration, Sound, Toast};
3
4fn main() {
5 let duration = Duration::Short;
6 let sound = Some(Sound::SMS);
7
8 let toast = Toast::new(Toast::POWERSHELL_APP_ID)
9 .title("first toast")
10 .text1("line1")
11 .duration(duration)
12 .sound(sound);
13
14 toast
15 .show()
16 // silently consume errors
17 .expect("notification failed");
18
19 toast
20 .show()
21 // silently consume errors
22 .expect("notification failed");
23}