Expand description
Win32 Notification
This library implements UWP XML Toast Notification This is a safe wrapper around the official WinRT apis
§Example
use win32_notif::{
notification::{
actions::ActionButton,
group::{Group, SubGroup},
visual::{
text::{HintAlign, HintStyle},
Text,
},
Scenario,
},
NotificationBuilder, ToastsNotifier,
};
pub fn main() {
let notifier = ToastsNotifier::new(Some("Microsoft.Windows.Explorer")).unwrap();
let notification = NotificationBuilder::new()
.with_scenario(Scenario::IncomingCall)
.with_use_button_style(true)
.visual(
Group::new()
.with_subgroup(
SubGroup::new().with_visual(Text::create(0, "Hello World").with_style(HintStyle::Title)),
)
.with_subgroup(
SubGroup::new().with_visual(
Text::create(0, "Hello World x2")
.with_style(HintStyle::Header)
.with_align(HintAlign::Right),
),
),
)
.action(
ActionButton::create("Answer")
.with_tooltip("Answer")
.with_id("answer"),
)
.build(1, ¬ifier, "a", "ahq")
.expect("Error");
notification.show().expect("Not Sent");
}Modules§
- data
- handler
- notification
- notifier
- registration
registration - Registration
Macros§
- string
- Creates a reference to a value in notification
Structs§
- Notification
- The Notification Object
- Notification
Activated Event Handler - Notification
Builder - The way to build a Notification
- Notification
Data Set - Notification
Dismissed Event Handler - Notification
Failed Event Handler - Toasts
Notifier