2012-08-07 2 views

답변

8

GetKeyboardLayoutList 기능을 사용해야합니다.

UINT uLayouts; 
HKL *lpList = NULL; 
wchar_t szBuf[512]; 

uLayouts = GetKeyboardLayoutList(0, NULL); 
lpList = (HKL*)LocalAlloc(LPTR, (uLayouts * sizeof(HKL))); 
uLayouts = GetKeyboardLayoutList(uLayouts, lpList); 

for(int i = 0; i < uLayouts; ++i) 
{ 
    GetLocaleInfo(MAKELCID(((UINT)lpList[i] & 0xffffffff), 
    SORT_DEFAULT), LOCALE_SLANGUAGE, szBuf, 512); 
    wprintf(L"%s\n", szBuf); 
    memset(szBuf, 0, 512); 
} 

if(lpList) 
    LocalFree(lpList); 
+0

감사 :

예를 들어, 콘솔의 출력에 모든 키보드 입력 언어는이 코드를 사용할 수 있습니다! 훌륭하게 작동합니다. – user1581390