#api #notifications #notif

win32_notif

Wrapper around Windows UWP XAML (WinRT) Notification api

9 releases (4 breaking)

new 0.7.0 May 10, 2025
0.6.0 May 9, 2025
0.5.2 May 9, 2025
0.4.3 May 8, 2025
0.2.5 Oct 31, 2024

#1168 in Database interfaces

Download history 6/week @ 2025-02-10 7/week @ 2025-02-17 2/week @ 2025-03-24 4/week @ 2025-03-31 61/week @ 2025-04-28 722/week @ 2025-05-05

783 downloads per month

MIT license

160KB
4K SLoC

Win32 Notification

This library implements UWP XML Toast Notification This is a safe wrapper around the official WinRT apis

Example

use win32_notif::{
 notification::visual::progress::Progress,
 string, NotificationBuilder, ToastsNotifier,
};

fn main() {
  let notifier = ToastsNotifier::new("Microsoft.Windows.Explorer").unwrap();
  let notif = NotificationBuilder::new()
    .visual(Progress::new(
      None,
      string!("Downloading..."),
      string!("0.30"),
      None,
    ))
    .build(1, &notifier, "a", "ahq")
    .unwrap();

  let _ = notif.show();
  loop {}
}

Win32 Notif

A lightweight crate to help you to compose beautiful notifications for Windows OS.

Usage

use win32_notif::{Notif, NotifIcon, NotifState, NotifType, NotifFlags};

fn main() {
  let notifier = ToastsNotifier::new("windows app user model id").unwrap();

  let notif = NotificationBuilder::new()
    .visual(Text::new(2, None, None, string!("Hello There 👋🏼")))
    .action(ActionButton::new(
      string!("Yes"),
      string!("yes"),
      ActivationType::Foreground,
      AfterActivationBehavior::Default,
      None,
      string!("yes"),
      HintButtonStyle::Success,
      string!("Yes"),
      false
    ))
    .build(2, &*NOTIFIER, "tag", "group")
    .unwrap();

  notif.show().unwrap();
}

Dependencies

~115MB
~2M SLoC