| Crates.io | register_app_for_toast |
| lib.rs | register_app_for_toast |
| version | 0.1.1 |
| created_at | 2025-08-30 20:46:22.348609+00 |
| updated_at | 2025-08-30 21:03:13.967607+00 |
| description | A crate that registers your commandline app for toast notifications, but only on Windows. |
| homepage | |
| repository | https://github.com/StrongTheDev/register-app-for-toast |
| max_upload_size | |
| id | 1817932 |
| size | 20,219 |
[!Note] This crate is for Windows only.
This is a crate that registers your commandline app for toast notifications, but only on Windows.
log is supported to give a few insights on what's happening in the background.
IMPORTANT !!:
It's designed to be used with winrt_toast_reborn because the register function in winrt_toast_reborn did not work for me.
The toast functions (from winrt_toast_reborn), however, worked fine.
Generate a GUID from any service (like DevToys) or online.
register the app & throw some toasts
use register_app_for_toast::register;
use winrt_toast_reborn::{Action as ToastAction, Toast, ToastManager};
fn main() {
// register the app
let aumid = "com.your.unique.app.id"; // any unique string
let clsid = "afe12491-6e01-42a5-bb43-d8467ff49af7"; // guid you generated
let app_name = "Cool App Name";
match register(
aumid,
clsid,
Some(app_name), // your app name
) {
Ok(_) => {
println!("Registered {aumid} as \"{app_name}\"");
}
Err(e) => {
eprintln!("Registration Error: {e}");
}
}
// then use a toast with some actions
let manager = ToastManager::new(app_aumid);
let mut toast = Toast::new();
toast
.text1("Toast Title!")
.action(ToastAction::new("Close", "close", "close"));
manager.show(&toast);
}
deregister function:// uninstaller.rs
use register_app_for_toast::deregister;
fn main() {
// register the app
let aumid = "com.your.unique.app.id"; // your app unique id
let clsid = "afe12491-6e01-42a5-bb43-d8467ff49af7"; // your clsid
let app_name = "Cool App Name";
match deregister(
aumid,
clsid,
Some(app_name), // your app name
) {
Ok(_) => {
println!("Deregistered {aumid} from system");
}
Err(e) => {
eprintln!("Deregistration Error: {e}");
}
}
}