win_msgbox/
cancel_try_again_continue.rs

1use super::Options;
2use windows_sys::Win32::UI::WindowsAndMessaging::{
3    IDCONTINUE, IDTRYAGAIN, MB_CANCELTRYCONTINUE, MESSAGEBOX_RESULT, MESSAGEBOX_STYLE,
4};
5
6/// The message box contains three push buttons: **Cancel**, **Try Again**, **Continue**.
7/// Use this message box type instead of [AbortRetryIgnore](crate::AbortRetryIgnore).
8#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
9pub enum CancelTryAgainContinue {
10    /// The **Cancel** button was selected.
11    Cancel,
12    /// The **Try Again** button was selected.
13    TryAgain,
14    /// The **Continue** button was selected.
15    Continue,
16}
17
18impl From<MESSAGEBOX_RESULT> for CancelTryAgainContinue {
19    fn from(value: MESSAGEBOX_RESULT) -> Self {
20        match value {
21            IDTRYAGAIN => Self::TryAgain,
22            IDCONTINUE => Self::Continue,
23            _ => Self::Cancel,
24        }
25    }
26}
27
28impl Options for CancelTryAgainContinue {
29    fn flags() -> MESSAGEBOX_STYLE {
30        MB_CANCELTRYCONTINUE
31    }
32}