Windows Task Dialog For Rust

Crates.io

Simply call the Win32 API TaskDialogIndirect in Rust.

Can be safely call on not windows platforms, but it has no effect.

Dependencies

```toml [dependencies] win-task-dialog = "0.1.3"

[build-dependencies] embed-resource = "1.6" ```

NOTE: You must be Enabling Visual Styles and using embed-resource to change manifest.

Example

```rust extern crate wintaskdialog;

use wintaskdialog::*;

fn main() { let conf = TaskDialogConfig { flags: TDFUSECOMMANDLINKS, commonbuttons: TDCBFOKBUTTON | TDCBFCANCELBUTTON, windowtitle: "Title 标题".tostring(), maininstruction: "Привет".tostring(), content: "こんにちは".tostring(), verificationtext: "VerificationText".tostring(), footer: "footer".tostring(), buttons: vec![ TaskDialogButton { id: 10, text: "One".tostring(), }, TaskDialogButton { id: 11, text: "贰".tostring(), }, ], defaultbutton: 11, radiobuttons: vec![ TaskDialogButton { id: 10, text: "Option 1".tostring(), }, TaskDialogButton { id: 11, text: "Option 2".tostring(), }, ], mainicon: TDSHIELDICON, footericon: TDINFORMATIONICON, ..Default::default() }; let result = showtaskdialog(&conf).unwrap(); println!( "{} {} {}", result.buttonid, result.radiobutton_id, result.checked, );

show_msg_dialog("Title", "Hi", "Info", TD_INFORMATION_ICON);
show_msg_dialog("Title", "!!!", "Error", TD_ERROR_ICON);

} ```

Example Screenshot

Screenshot