raw/
raw.rs

1use win_msgbox::{
2    raw::{self, w},
3    CancelTryAgainContinue::{self, *},
4    Result,
5};
6
7fn main() -> Result<()> {
8    // Safety: `w!` creates null-terminated UTF-16 strings at compile time, thus the pointed-to value never changes.
9    let response = unsafe {
10        raw::error::<CancelTryAgainContinue>(w!("Couldn't download resource"))
11            .title(w!("Download Error"))
12            .show()?
13    };
14
15    match response {
16        Cancel => println!("Cancelling downlaod..."),
17        TryAgain => println!("Attempting redownload..."),
18        Continue => println!("Skipping resource"),
19    }
20
21    Ok(())
22}