From e997c67da3a76ecacb2800a8a5efc26a30fed18c Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Mon, 25 Oct 2021 05:42:41 +0300 Subject: [PATCH] Preliminary language support in GUI --- ExplorerPatcher/GUI.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ExplorerPatcher/GUI.c b/ExplorerPatcher/GUI.c index 96a2344..6868a95 100644 --- a/ExplorerPatcher/GUI.c +++ b/ExplorerPatcher/GUI.c @@ -1,5 +1,6 @@ #include "GUI.h" +LANGID locale; void* GUI_FileMapping = NULL; DWORD GUI_FileSize = 0; BOOL g_darkModeEnabled = FALSE; @@ -1416,10 +1417,21 @@ __declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLin stdout ); } + dwSize = LOCALE_NAME_MAX_LENGTH; + locale = GetUserDefaultUILanguage(); + RegQueryValueExW( + hKey, + TEXT("Language"), + 0, + NULL, + &locale, + &dwSize + ); if (hKey) { RegCloseKey(hKey); } + wprintf(L"%d\n", locale); wchar_t wszPath[MAX_PATH]; ZeroMemory(