win_msgbox/
abort_retry_ignore.rs

1use super::Options;
2use windows_sys::Win32::UI::WindowsAndMessaging::{
3    IDABORT, IDRETRY, MB_ABORTRETRYIGNORE, MESSAGEBOX_RESULT, MESSAGEBOX_STYLE,
4};
5
6/// The message box contains three push buttons: **Abort**, **Retry**, and **Ignore**.
7#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
8pub enum AbortRetryIgnore {
9    /// The **Abort** button was selected.
10    Abort,
11    /// The **Retry** button was selected.
12    Retry,
13    /// The **Ignore** button was selected.
14    Ignore,
15}
16
17impl From<MESSAGEBOX_RESULT> for AbortRetryIgnore {
18    fn from(value: MESSAGEBOX_RESULT) -> Self {
19        match value {
20            IDABORT => Self::Abort,
21            IDRETRY => Self::Retry,
22            _ => Self::Ignore,
23        }
24    }
25}
26
27impl Options for AbortRetryIgnore {
28    fn flags() -> MESSAGEBOX_STYLE {
29        MB_ABORTRETRYIGNORE
30    }
31}