diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f7a723..b274cb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Tested on OS build 22000.434. * The weather widget recomputes its area automatically, by default, in order to fit its contents, instead of remaining at a fixed size; there is also an option to choose between the two behaviors (.1) * Possibility to disable the icon in the weather widget (.1) +* The weather widget defaults to showing in the preferred language set in Windows, instead of English (#734) (.2) #### Fixes @@ -21,6 +22,8 @@ Tested on OS build 22000.434. * Fixed inconsistencies when displaying the weather widget and the system themes are disabled (aka the classic theme is used) (.1) * Screen readers now read the weather data when requested for the weather widget (.1) * Changing the Start button style or weather widget layout does not toggle taskbar auto-hide now; instead, the settings take effect immediately (.1) +* Fixed a bug that could corrupt registry entries of type REG_SZ set via the Properties UI (#734) (.2) +* Fixed a bug that reset the setting when pressing "Cancel" in an input box in the Properties UI (#734) (.2) ## 22000.469.41 diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index a9872fe..d527a34 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -5451,13 +5451,51 @@ void WINAPI LoadSettings(LPARAM lParam) &dwSize )) { - wcscpy_s(wszWeatherLanguage, MAX_PATH, L"en"); + BOOL bOk = FALSE; + ULONG ulNumLanguages = 0; + LPCWSTR wszLanguagesBuffer = NULL; + ULONG cchLanguagesBuffer = 0; + if (GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &ulNumLanguages, NULL, &cchLanguagesBuffer)) + { + if (wszLanguagesBuffer = malloc(cchLanguagesBuffer * sizeof(WCHAR))) + { + if (GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &ulNumLanguages, wszLanguagesBuffer, &cchLanguagesBuffer)) + { + wcscpy_s(wszWeatherLanguage, MAX_PATH, wszLanguagesBuffer); + bOk = TRUE; + } + free(wszLanguagesBuffer); + } + } + if (!bOk) + { + wcscpy_s(wszWeatherLanguage, MAX_PATH, L"en-US"); + } } else { if (wszWeatherLanguage[0] == 0) { - wcscpy_s(wszWeatherLanguage, MAX_PATH, L"en"); + BOOL bOk = FALSE; + ULONG ulNumLanguages = 0; + LPCWSTR wszLanguagesBuffer = NULL; + ULONG cchLanguagesBuffer = 0; + if (GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &ulNumLanguages, NULL, &cchLanguagesBuffer)) + { + if (wszLanguagesBuffer = malloc(cchLanguagesBuffer * sizeof(WCHAR))) + { + if (GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &ulNumLanguages, wszLanguagesBuffer, &cchLanguagesBuffer)) + { + wcscpy_s(wszWeatherLanguage, MAX_PATH, wszLanguagesBuffer); + bOk = TRUE; + } + free(wszLanguagesBuffer); + } + } + if (!bOk) + { + wcscpy_s(wszWeatherLanguage, MAX_PATH, L"en-US"); + } } } if (epw) diff --git a/version.h b/version.h index 66a0050..d89c98a 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define VER_MAJOR 22000 #define VER_MINOR 469 #define VER_BUILD_HI 42 -#define VER_BUILD_LO 1 +#define VER_BUILD_LO 2 #define VER_FLAGS VS_FF_PRERELEASE @@ -12,5 +12,5 @@ #define VER_STR(arg) #arg // The String form of the version numbers -#define VER_FILE_STRING VALUE "FileVersion", "22000.469.42.1" -#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.469.42.1" +#define VER_FILE_STRING VALUE "FileVersion", "22000.469.42.2" +#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.469.42.2"