mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 01:45:40 +00:00
[INPUT]
- Show localized keyboard layout name svn path=/trunk/; revision=72235
This commit is contained in:
parent
445ae177c1
commit
d5ac073cbc
1 changed files with 64 additions and 4 deletions
|
@ -148,13 +148,73 @@ LayoutList_Create(VOID)
|
||||||
dwSize = sizeof(szBuffer);
|
dwSize = sizeof(szBuffer);
|
||||||
|
|
||||||
if (RegQueryValueExW(hLayoutKey,
|
if (RegQueryValueExW(hLayoutKey,
|
||||||
L"Layout Text",
|
L"Layout Display Name",
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
(LPBYTE)szBuffer, &dwSize) == ERROR_SUCCESS)
|
(LPBYTE)szBuffer, &dwSize) == ERROR_SUCCESS &&
|
||||||
|
szBuffer[0] == L'@')
|
||||||
{
|
{
|
||||||
DWORD dwLayoutId = DWORDfromString(szLayoutId);
|
WCHAR szPath[MAX_PATH];
|
||||||
|
WCHAR *pBuffer;
|
||||||
|
WCHAR *pIndex;
|
||||||
|
INT iIndex;
|
||||||
|
|
||||||
LayoutList_AppendNode(dwLayoutId, dwSpecialId, szBuffer);
|
/* Move to the position after the character "@" */
|
||||||
|
pBuffer = szBuffer + 1;
|
||||||
|
|
||||||
|
/* Get a pointer to the beginning ",-" */
|
||||||
|
pIndex = wcsstr(pBuffer, L",-");
|
||||||
|
|
||||||
|
/* Convert the number in the string after the ",-" */
|
||||||
|
iIndex = _wtoi(pIndex + 2);
|
||||||
|
|
||||||
|
pIndex[0] = 0;
|
||||||
|
|
||||||
|
if (ExpandEnvironmentStringsW(pBuffer, szPath, ARRAYSIZE(szPath)) != 0)
|
||||||
|
{
|
||||||
|
HANDLE hHandle;
|
||||||
|
|
||||||
|
hHandle = LoadLibraryW(szPath);
|
||||||
|
if (hHandle != NULL)
|
||||||
|
{
|
||||||
|
INT iLength = LoadStringW(hHandle, iIndex, szBuffer, ARRAYSIZE(szBuffer));
|
||||||
|
|
||||||
|
FreeLibrary(hHandle);
|
||||||
|
|
||||||
|
if (iLength != 0)
|
||||||
|
{
|
||||||
|
DWORD dwLayoutId = DWORDfromString(szLayoutId);
|
||||||
|
|
||||||
|
LayoutList_AppendNode(dwLayoutId, dwSpecialId, szBuffer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
goto NotTranslated;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
goto NotTranslated;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
goto NotTranslated;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NotTranslated:
|
||||||
|
dwSize = sizeof(szBuffer);
|
||||||
|
|
||||||
|
if (RegQueryValueExW(hLayoutKey,
|
||||||
|
L"Layout Text",
|
||||||
|
NULL, NULL,
|
||||||
|
(LPBYTE)szBuffer, &dwSize) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
DWORD dwLayoutId = DWORDfromString(szLayoutId);
|
||||||
|
|
||||||
|
LayoutList_AppendNode(dwLayoutId, dwSpecialId, szBuffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue