diff --git a/inc/dllmain.h b/inc/dllmain.h index 13039f8..f7e028b 100644 --- a/inc/dllmain.h +++ b/inc/dllmain.h @@ -31,7 +31,6 @@ typedef BOOL(__stdcall* SETPROCESSDPIAWARENESSCONTEXTPROC)(DPI_AWARENESS_CONTEXT #if (_WIN32_WINNT < _WIN32_WINNT_WINXP) #define SetThreadExecutionState(a) -#define DisableProcessWindowsGhosting() #endif #endif diff --git a/src/dllmain.c b/src/dllmain.c index e596372..8832177 100644 --- a/src/dllmain.c +++ b/src/dllmain.c @@ -57,11 +57,6 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved) g_dbg_exception_handle = add_handler(1, (PVECTORED_EXCEPTION_HANDLER)dbg_vectored_exception_handler); } - if (g_config.darkcolony_hack) - { - DisableProcessWindowsGhosting(); - } - char buf[1024]; if (GetEnvironmentVariable("__COMPAT_LAYER", buf, sizeof(buf))) diff --git a/src/winapi_hooks.c b/src/winapi_hooks.c index c44cd3a..33655c1 100644 --- a/src/winapi_hooks.c +++ b/src/winapi_hooks.c @@ -780,6 +780,14 @@ BOOL WINAPI fake_GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wM BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg) { + if (g_config.darkcolony_hack && !hWnd) + { + hWnd = g_ddraw.hwnd; + + MSG msg; + real_PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); + } + if (g_config.limiter_type == LIMIT_PEEKMESSAGE && g_ddraw.ticks_limiter.tick_length > 0 && InterlockedExchange(&g_ddraw.render.screen_updated, FALSE))