https://github.com/amaranthinecodices/win32_notification
Sending Win32 notifications in Rust
https://github.com/amaranthinecodices/win32_notification
Last synced: 9 months ago
JSON representation
Sending Win32 notifications in Rust
- Host: GitHub
- URL: https://github.com/amaranthinecodices/win32_notification
- Owner: AmaranthineCodices
- License: mit
- Created: 2020-01-04T19:11:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-08T15:10:45.000Z (over 4 years ago)
- Last Synced: 2025-03-17T23:56:43.093Z (over 1 year ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# `win32_notification`
A simple wrapper around [`Shell_NotifyIcon`](https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shell_notifyiconw). See [my blog post](https://lily.fyi/blog/posts/rust-windows-notifications/) for more information on how this works.
```rust
use std::thread;
use std::time::Duration;
use win32_notification::NotificationBuilder;
fn main() {
let notification = NotificationBuilder::new()
.title_text("Notification Title")
.info_text("This is the notification body")
.build()
.expect("Could not create notification");
notification.show().expect("Failed to show notification");
thread::sleep(Duration::from_secs(5));
notification
.delete()
.expect("Failed to delete notification");
}
```