+ wsprintf(value, L"%08x", (DWORD)pGlobalData->lcid);
+ valuesize = (wcslen(value) + 1) * sizeof(WCHAR);
+
+ if (pGlobalData->bApplyToDefaultUser)
+ {
+ ret = RegOpenKeyExW(HKEY_USERS,
+ L".DEFAULT\\Control Panel\\International",
+ 0,
+ KEY_WRITE,
+ &localeKey);
+ if (ret != ERROR_SUCCESS)
+ {
+ PrintErrorMsgBox(IDS_ERROR_DEF_INT_KEY_REG);
+ return;
+ }
+
+ ret = RegSetValueExW(localeKey, L"Locale", 0, REG_SZ, (PBYTE)value, valuesize);
+ if (ret != ERROR_SUCCESS)
+ {
+ RegCloseKey(localeKey);
+ PrintErrorMsgBox(IDS_ERROR_INT_KEY_REG);
+ return;
+ }
+
+ for (i = 0; i < pGlobalData->dwLocaleCount; i++)
+ {
+ RegSetValueExW(localeKey,
+ LocaleKeyData[i].pKeyName,
+ 0,
+ REG_SZ,
+ (PBYTE)pGlobalData->pLocaleArray[i],
+ (wcslen(pGlobalData->pLocaleArray[i]) + 1) * sizeof(WCHAR));
+ }
+
+ /* Flush and close the locale key */
+ RegFlushKey(localeKey);
+ RegCloseKey(localeKey);
+ }
+