Simply call the Win32 API TaskDialogIndirect
in Rust.
```toml [dependencies] win-task-dialog-for-rust = "0.1.0"
[build-dependencies] embed-resource = "1.6" ```
NOTE: You must be Enabling Visual Styles and using embed-resource to change manifest.
```rust extern crate wintaskdialog;
use wintaskdialog::*;
fn main() { let conf = TaskDialogConfig { parent: std::ptr::nullmut(), instance: std::ptr::nullmut(), flags: TDFUSECOMMANDLINKS, commonbuttons: TDCBFOKBUTTON | TDCBFCANCELBUTTON, windowtitle: "Title 标题".tostring(), maininstruction: "Привет".tostring(), content: "こんにちは".tostring(), verificationtext: "VerificationText".tostring(), expandedinformation: "".tostring(), expandedcontroltext: "".tostring(), collapsedcontroltext: "".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(), }, ], defaultradiobuttons: 0, mainicon: TDSHIELDICON, footericon: TDINFORMATIONICON, }; let result = showtaskdialog(&conf).unwrap(); println!( "{} {} {}", result.buttonid, result.radiobutton_id, result.checked, ) }
```