Crates.io | win_dialog |
lib.rs | win_dialog |
version | 1.0.1 |
source | src |
created_at | 2024-05-27 23:05:21.501513 |
updated_at | 2024-06-02 23:04:56.685826 |
description | An idiomatic wrapper around windows MessageBox function for providing message dialogs in Windows. |
homepage | |
repository | https://github.com/toadslop/win-dialog |
max_upload_size | |
id | 1253840 |
size | 51,988 |
An idiomatic Rust interface for the Windows message box API.
One can simply use the windows crate to invoke this api, but the api is a rather old-fashioned C-style API, so its rather unintuitive for a Rust developer without C programming experience to use. This create wraps the raw API with a familiar interface and provides more complete documentation about how to use it than the official crate documentation does.
A Windows message box looks like this:
You have the ability to make the following changes:
use win_dialog::{style, Icon, WinDialog};
fn main() {
let res =
WinDialog::new("We encountered an error during installation. What would you like to do?")
.with_style(style::AbortRetryIgnore)
.with_icon(Icon::Hand)
.show()
.unwrap();
println!("{res:?}");
}