1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-25 10:07:47 +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

@ -222,18 +222,33 @@ BOOL util_caller_is_ddraw_wrapper(void* return_address)
if ((getModuleHandleExA(flags, return_address, &mod) && mod == age_dll) ||
(getModuleHandleExA(flags, directDrawCreate, &mod) && mod == age_dll) ||
(getModuleHandleExA(flags, directDrawCreateEx, &mod) && mod == age_dll))
{
HKEY hkey;
LONG status =
RegOpenKeyExA(HKEY_CURRENT_USER, "SOFTWARE\\Voobly\\Voobly\\game\\13", 0L, KEY_READ, &hkey);
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 \n"
"on 'Game', now select 'DirectX' and disable 'Render in 32-bit color'.",
"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;
}
}
}
}
return FALSE;
}