Reworked the behavior of the shutdown status message, and the virtual machine and manager window messages are now paused in case of a message box issued by a command from the manager.

This commit is contained in:
OBattler
2019-11-02 16:18:18 +01:00
parent ee77bc1471
commit 7807548be6
4 changed files with 53 additions and 31 deletions

View File

@@ -8,7 +8,7 @@
*
* Platform main support module for Windows.
*
* Version: @(#)win.c 1.0.58 2019/10/19
* Version: @(#)win.c 1.0.59 2019/11/02
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -197,11 +197,6 @@ set_language(int id)
/* Load the strings table for this ID. */
LoadCommonStrings();
#if 0
/* Update the menus for this ID. */
MenuUpdate();
#endif
}
}
@@ -344,6 +339,14 @@ ProcessCommandLine(wchar_t ***argw)
}
static void
shutdown_notify(void)
{
if (source_hwnd)
PostMessage((HWND) (uintptr_t) source_hwnd, WM_SENDSDSTATUS, (WPARAM) 1, (LPARAM) hwndMain);
}
/* For the Windows platform, this is the start of the application. */
int WINAPI
WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
@@ -381,6 +384,10 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
if (! pc_init(argc, argw)) {
/* Detach from console. */
CreateConsole(0);
if (source_hwnd)
PostMessage((HWND) (uintptr_t) source_hwnd, WM_SENDSDSTATUS, (WPARAM) 1, (LPARAM) hwndMain);
return(1);
}
@@ -391,6 +398,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
/* Handle our GUI. */
i = ui_init(nCmdShow);
atexit(shutdown_notify);
return(i);
}
@@ -428,6 +437,8 @@ do_stop(void)
plat_delay_ms(100);
shutdown_notify();
pc_close(thMain);
thMain = NULL;
@@ -627,7 +638,6 @@ plat_dir_check(wchar_t *path)
int
plat_dir_create(wchar_t *path)
{
// return((int)CreateDirectory(path, NULL));
return((int)SHCreateDirectory(hwndMain, path));
}
@@ -696,10 +706,6 @@ plat_vidapi_name(int api)
break;
case 2:
#if 0
/* Direct3D is default. */
name = "d3d";
#endif
break;
case 3:
@@ -707,10 +713,6 @@ plat_vidapi_name(int api)
break;
#else
case 1:
#if 0
/* Direct3D is default. */
name = "d3d";
#endif
break;
case 2: