1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-25 01:57:47 +01:00

add new .ini setting "terminate_process"

This commit is contained in:
FunkyFr3sh 2025-01-02 01:22:03 +01:00
parent 7df6a4e47b
commit ed8584129d
4 changed files with 9 additions and 0 deletions

View File

@ -80,6 +80,7 @@ typedef struct CNCDDRAWCONFIG
BOOL limit_gdi_handles; BOOL limit_gdi_handles;
BOOL remove_menu; BOOL remove_menu;
int refresh_rate; int refresh_rate;
int terminate_process;
/* Hotkeys */ /* Hotkeys */

View File

@ -93,6 +93,7 @@ void cfg_load()
GET_BOOL(g_config.limit_gdi_handles, "limit_gdi_handles", FALSE); GET_BOOL(g_config.limit_gdi_handles, "limit_gdi_handles", FALSE);
GET_BOOL(g_config.remove_menu, "remove_menu", FALSE); GET_BOOL(g_config.remove_menu, "remove_menu", FALSE);
GET_INT(g_config.refresh_rate, "refresh_rate", 0); GET_INT(g_config.refresh_rate, "refresh_rate", 0);
GET_BOOL(g_config.terminate_process, "terminate_process", FALSE);
/* Hotkeys */ /* Hotkeys */
@ -336,6 +337,7 @@ static void cfg_create_ini()
"limit_gdi_handles=false\n" "limit_gdi_handles=false\n"
"remove_menu=false\n" "remove_menu=false\n"
"refresh_rate=0\n" "refresh_rate=0\n"
"terminate_process=false\n"
"\n" "\n"
"\n" "\n"
"\n" "\n"

View File

@ -179,6 +179,9 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
if (g_dbg_exception_handle && remove_handler) if (g_dbg_exception_handle && remove_handler)
remove_handler(g_dbg_exception_handle); remove_handler(g_dbg_exception_handle);
if (g_config.terminate_process == 2)
TerminateProcess(GetCurrentProcess(), 0);
break; break;
} }
case DLL_THREAD_ATTACH: case DLL_THREAD_ATTACH:

View File

@ -620,6 +620,9 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
if (wParam == SC_CLOSE && !GameHandlesClose) if (wParam == SC_CLOSE && !GameHandlesClose)
{ {
if (g_config.terminate_process)
g_config.terminate_process = 2;
ExitProcess(0); ExitProcess(0);
//_exit(0); //_exit(0);
} }