mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 04:37:15 +00:00
Make intl.cpl really switch InstallLanguage and Default entries of NLS\Language key. Problem with freeldr solved in hacky way - it writes now e.g. "0409" and not "00000409", as it generally should.
svn path=/trunk/; revision=15049
This commit is contained in:
parent
ecba32de75
commit
c72be4b69c
1 changed files with 34 additions and 34 deletions
|
@ -83,40 +83,43 @@ CreateLanguagesList(HWND hwnd)
|
||||||
(LPARAM)langSel);
|
(LPARAM)langSel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Sets new locale
|
||||||
static VOID
|
void SetNewLocale(LCID lcid)
|
||||||
ShowLanguagesList(HWND hwnd)
|
|
||||||
{
|
{
|
||||||
TIME_ZONE_INFORMATION TimeZoneInfo;
|
// HKCU\\Control Panel\\International\\Locale = 0409 (type=0)
|
||||||
PTIMEZONE_ENTRY Entry;
|
// HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","Default",0x00000000,"0409" (type=0)
|
||||||
DWORD dwIndex;
|
// HKLM,"SYSTEM\CurrentControlSet\Control\NLS\Language","InstallLanguage",0x00000000,"0409" (type=0)
|
||||||
DWORD i;
|
|
||||||
|
|
||||||
GetTimeZoneInformation(&TimeZoneInfo);
|
// Set locale
|
||||||
|
HKEY localeKey;
|
||||||
|
HKEY langKey;
|
||||||
|
DWORD ret;
|
||||||
|
TCHAR value[9];
|
||||||
|
|
||||||
dwIndex = 0;
|
ret = RegOpenKeyW(HKEY_CURRENT_USER, L"Control Panel\\International", &localeKey);
|
||||||
i = 0;
|
|
||||||
Entry = TimeZoneListHead;
|
if (ret != ERROR_SUCCESS)
|
||||||
while (Entry != NULL)
|
|
||||||
{
|
{
|
||||||
SendMessageW(hwnd,
|
// some serious error
|
||||||
CB_ADDSTRING,
|
//TODO: Tell user about it
|
||||||
0,
|
return;
|
||||||
(LPARAM)Entry->Description);
|
|
||||||
|
|
||||||
if (!wcscmp(Entry->StandardName, TimeZoneInfo.StandardName))
|
|
||||||
dwIndex = i;
|
|
||||||
|
|
||||||
i++;
|
|
||||||
Entry = Entry->Next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SendMessageW(hwnd,
|
wsprintf(value, L"%04x", (DWORD)lcid);
|
||||||
CB_SETCURSEL,
|
|
||||||
(WPARAM)dwIndex,
|
RegSetValueExW(localeKey, L"Locale", 0, REG_SZ, (BYTE *)value, sizeof(value));
|
||||||
0);
|
RegCloseKey(localeKey);
|
||||||
|
|
||||||
|
// Set language
|
||||||
|
ret = RegOpenKeyW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\NLS\\Language", &langKey);
|
||||||
|
|
||||||
|
if (ret != ERROR_SUCCESS)
|
||||||
|
return;
|
||||||
|
|
||||||
|
RegSetValueExW(langKey, L"Default", 0, REG_SZ, (BYTE *)value, sizeof(value));
|
||||||
|
RegSetValueExW(langKey, L"InstallLanguage", 0, REG_SZ, (BYTE *)value, sizeof(value));
|
||||||
|
RegCloseKey(langKey);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
/* Property page dialog callback */
|
/* Property page dialog callback */
|
||||||
INT_PTR CALLBACK
|
INT_PTR CALLBACK
|
||||||
|
@ -150,7 +153,6 @@ LocalePageProc(HWND hwndDlg,
|
||||||
// Apply changes
|
// Apply changes
|
||||||
LCID NewLcid;
|
LCID NewLcid;
|
||||||
int iCurSel;
|
int iCurSel;
|
||||||
char tmp[100];
|
|
||||||
|
|
||||||
// Acquire new value
|
// Acquire new value
|
||||||
iCurSel = SendMessageW(hList,
|
iCurSel = SendMessageW(hList,
|
||||||
|
@ -169,10 +171,8 @@ LocalePageProc(HWND hwndDlg,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
//TOOD: Actually set new locale
|
// Actually set new locale
|
||||||
|
SetNewLocale(NewLcid);
|
||||||
sprintf(tmp, "%x, cursel=%d", NewLcid, iCurSel);
|
|
||||||
MessageBoxA(hwndDlg, tmp, "debug", MB_OK);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue