1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-28 01:10:55 +01:00

Preliminary language support in GUI

This commit is contained in:
Valentin Radu 2021-10-25 05:42:41 +03:00
parent 68f32441fb
commit e997c67da3

View File

@ -1,5 +1,6 @@
#include "GUI.h" #include "GUI.h"
LANGID locale;
void* GUI_FileMapping = NULL; void* GUI_FileMapping = NULL;
DWORD GUI_FileSize = 0; DWORD GUI_FileSize = 0;
BOOL g_darkModeEnabled = FALSE; BOOL g_darkModeEnabled = FALSE;
@ -1416,10 +1417,21 @@ __declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLin
stdout stdout
); );
} }
dwSize = LOCALE_NAME_MAX_LENGTH;
locale = GetUserDefaultUILanguage();
RegQueryValueExW(
hKey,
TEXT("Language"),
0,
NULL,
&locale,
&dwSize
);
if (hKey) if (hKey)
{ {
RegCloseKey(hKey); RegCloseKey(hKey);
} }
wprintf(L"%d\n", locale);
wchar_t wszPath[MAX_PATH]; wchar_t wszPath[MAX_PATH];
ZeroMemory( ZeroMemory(