1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

check registry key for voobly AOE2 windowed detection

This commit is contained in:
FunkyFr3sh 2024-07-18 01:09:14 +02:00
parent 25b4bb8ce5
commit 8b41ad1aa4

View File

@ -223,15 +223,30 @@ BOOL util_caller_is_ddraw_wrapper(void* return_address)
(getModuleHandleExA(flags, directDrawCreate, &mod) && mod == age_dll) ||
(getModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == age_dll))
{
MessageBoxA(
NULL,
"Error: You cannot combine cnc-ddraw with other DirectDraw wrappers. \n\n"
"Please disable the other wrapper by clicking in the game room on the very top \n"
"on 'Game', now select 'DirectX' and disable 'Render in 32-bit color'.",
"Conflicting DirectDraw wrapper detected - cnc-ddraw",
MB_OK | MB_TOPMOST);
HKEY hkey;
LONG status =
RegOpenKeyExA(HKEY_CURRENT_USER, "SOFTWARE\\Voobly\\Voobly\\game\\13", 0L, KEY_READ, &hkey);
return TRUE;
if (status == ERROR_SUCCESS)
{
char windowed[256] = { 0 };
DWORD size = sizeof(windowed);
RegQueryValueExA(hkey, "windowmode", NULL, NULL, (PVOID)&windowed, &size);
RegCloseKey(hkey);
if (tolower(windowed[0]) == 't')
{
MessageBoxA(
NULL,
"Error: You cannot combine cnc-ddraw with other DirectDraw wrappers. \n\n"
"Please disable the other wrapper by clicking in the game room on the very top "
"on 'Game', now select 'DirectX' and disable 'Start in Window-Mode'.",
"Conflicting DirectDraw wrapper detected - cnc-ddraw",
MB_OK | MB_TOPMOST);
return TRUE;
}
}
}
}