windows-erg 0.1.0

Ergonomic, idiomatic Rust wrappers for Windows APIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::time::Duration;

use windows_erg::desktop::{BalloonIcon, TrayIcon, TrayIconId, TrayNotification};

fn main() -> windows_erg::Result<()> {
    let mut tray = TrayIcon::new(TrayIconId::new(1), "windows-erg demo")?;

    tray.show_notification(&TrayNotification::new(
        "windows-erg",
        "Tray notification from windows-erg",
        BalloonIcon::Info,
    ))?;

    std::thread::sleep(Duration::from_secs(5));

    tray.remove()?;
    Ok(())
}