I am developing an app using VC6 on WIn XP. To retrieve default input language list from system GetKeyBoardLayoutList() and GetLocalInfo() APIs are used.
Follwoing is the code.
`UINT uLayouts;
char szBuf[512];
HKL *lpList = NULL;
uLayouts = GetKeyboardLayoutList(0, NULL);
lpList = (HKL*)LocalAlloc(LPTR, (uLayouts * sizeof(HKL)));
uLayouts = GetKeyboardLayoutList(uLayouts, lpList);
for(UINT i = 0; i < uLayouts; i++)
{
DWORD temp = (UINT)lpList[i] & 0xffffffff;
GetLocaleInfo(MAKELCID(temp,SORT_DEFAULT), LOCALE_SLANGUAGE , szBuf, 512);
}`
In szBuf i am getting the input language name as "English (United States)" where as actaul name in OS is "English (United States) - US"
How can we get the exact name of input language present in the OS? We tried using different flags as well like,
LOCALE_SENGLANGUAGE //English
LOCALE_ILANGUAGE, LOCALE_SLANGUAGE, LOCALE_ICOUNTRY, LOCALE_SABBREVLANGNAME, LOCALE_SNATIVELANGNAME, LOCALE_SABBREVCTRYNAME, LOCALE_SNATIVECTRYNAME
however not able to fetch exact language name.
use this:
LOCALE_IMEASURE // 0 = metric, 1 = US
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With