return ret;
}
+bool quit_ok()
+{
+ if (isfullscreen() > 0)
+ return true;
+ if (!currprefs.win32_warn_exit)
+ return true;
+ if (quit_program == -UAE_QUIT)
+ return true;
+ TCHAR temp[MAX_DPATH];
+ WIN32GUI_LoadUIString(IDS_QUIT_WARNING, temp, MAX_DPATH);
+ int ret = gui_message_multibutton(1, temp);
+ return ret == 1;
+}
+
static void setcursor(struct AmigaMonitor *mon, int oldx, int oldy)
{
int dx = (mon->amigawinclip_rect.left - mon->amigawin_rect.left) + (mon->amigawinclip_rect.right - mon->amigawinclip_rect.left) / 2;
return 0;
case WM_CLOSE:
- uae_quit();
+ if (quit_ok())
+ uae_quit();
return 0;
case WM_WINDOWPOSCHANGED:
{
LRESULT lr;
-#ifdef RETROPLATFORM
if ((wParam & 0xfff0) == SC_CLOSE) {
+#ifdef RETROPLATFORM
if (rp_close())
return 0;
- }
#endif
+
+ if (!quit_ok())
+ return 0;
+ uae_quit();
+ }
lr = DefWindowProc(hWnd, message, wParam, lParam);
switch (wParam & 0xfff0)
{
case SC_RESTORE:
break;
case SC_CLOSE:
- uae_quit();
break;
}
return lr;
cfgfile_target_dwrite_bool(f, _T("filesystem_mangle_reserved_names"), p->win32_filesystem_mangle_reserved_names);
cfgfile_target_dwrite_bool(f, _T("right_control_is_right_win"), p->right_control_is_right_win_key);
cfgfile_target_dwrite_bool(f, _T("windows_shutdown_notification"), p->win32_shutdown_notification);
+ cfgfile_target_dwrite_bool(f, _T("warn_exit"), p->win32_warn_exit);
cfgfile_target_dwrite(f, _T("extraframewait"), _T("%d"), extraframewait);
cfgfile_target_dwrite(f, _T("extraframewait_us"), _T("%d"), extraframewait2);
|| cfgfile_yesno(option, value, _T("filesystem_mangle_reserved_names"), &p->win32_filesystem_mangle_reserved_names)
|| cfgfile_yesno(option, value, _T("right_control_is_right_win"), &p->right_control_is_right_win_key)
|| cfgfile_yesno(option, value, _T("windows_shutdown_notification"), &p->win32_shutdown_notification)
+ || cfgfile_yesno(option, value, _T("warn_exit"), &p->win32_warn_exit)
|| cfgfile_intval(option, value, _T("extraframewait"), &extraframewait, 1)
|| cfgfile_intval(option, value, _T("extraframewait_us"), &extraframewait2, 1)
|| cfgfile_intval(option, value, _T("framelatency"), &forcedframelatency, 1)
currprefs.win32_iconified_pause != changed_prefs.win32_iconified_pause ||
currprefs.win32_iconified_input != changed_prefs.win32_iconified_input ||
currprefs.win32_ctrl_F11_is_quit != changed_prefs.win32_ctrl_F11_is_quit ||
+ currprefs.win32_warn_exit != changed_prefs.win32_warn_exit ||
currprefs.right_control_is_right_win_key != changed_prefs.right_control_is_right_win_key)
{
currprefs.win32_minimize_inactive = changed_prefs.win32_minimize_inactive;
currprefs.win32_iconified_pause = changed_prefs.win32_iconified_pause;
currprefs.win32_iconified_input = changed_prefs.win32_iconified_input;
currprefs.win32_ctrl_F11_is_quit = changed_prefs.win32_ctrl_F11_is_quit;
+ currprefs.win32_warn_exit = changed_prefs.win32_warn_exit;
currprefs.right_control_is_right_win_key = changed_prefs.right_control_is_right_win_key;
inputdevice_unacquire ();
currprefs.keyboard_leds_in_use = changed_prefs.keyboard_leds_in_use = (currprefs.keyboard_leds[0] | currprefs.keyboard_leds[1] | currprefs.keyboard_leds[2]) != 0;
{ 0, 0, _T("Hide all UAE autoconfig boards"), &workprefs.uae_hide_autoconfig },
{ 0, 1, _T("Right Control = Right Windows key"), &workprefs.right_control_is_right_win_key },
{ 0, 0, _T("Windows shutdown/logoff notification"), &workprefs.win32_shutdown_notification },
+ { 0, 1, _T("Warn when attempting to close window"), &workprefs.win32_warn_exit },
{ 0, NULL }
};