Added confirmation dialogs on hard reset and exit.

*** WARNING ***
86Box v2.00 is now in feature freeze, any new features are going to be added in v2.10 instead. Bug reports for v2.00 are still accepted, however.
This commit is contained in:
OBattler
2019-09-22 21:10:47 +02:00
parent 7108043872
commit 98d7e96f67
7 changed files with 47 additions and 21 deletions

View File

@@ -275,7 +275,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HMENU hmenu;
int sb_borders[3];
int i, sb_borders[3];
RECT rect;
int temp_x, temp_y;
@@ -297,7 +297,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case IDM_ACTION_HRESET:
pc_reset(1);
i = ui_msgbox(MBX_QUESTION_YN, (wchar_t *)IDS_2121);
if (i == 0)
pc_reset(1);
break;
case IDM_ACTION_RESET_CAD:
@@ -305,7 +307,12 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case IDM_ACTION_EXIT:
PostQuitMessage(0);
i = ui_msgbox(MBX_QUESTION_YN, (wchar_t *)IDS_2122);
if (i == 0) {
UnhookWindowsHookEx(hKeyboardHook);
KillTimer(hwnd, TIMER_1SEC);
PostQuitMessage(0);
}
break;
case IDM_ACTION_CTRL_ALT_ESC:
@@ -661,6 +668,15 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_SYSKEYUP:
return(0);
case WM_CLOSE:
i = ui_msgbox(MBX_QUESTION_YN, (wchar_t *)IDS_2122);
if (i == 0) {
UnhookWindowsHookEx(hKeyboardHook);
KillTimer(hwnd, TIMER_1SEC);
PostQuitMessage(0);
}
break;
case WM_DESTROY:
UnhookWindowsHookEx(hKeyboardHook);
KillTimer(hwnd, TIMER_1SEC);
@@ -681,6 +697,8 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_SHUTDOWN:
UnhookWindowsHookEx(hKeyboardHook);
KillTimer(hwnd, TIMER_1SEC);
PostQuitMessage(0);
break;