반응형
아래와 같이 가져올 수 있음.
리턴되는 값은 문자열로 처리를 원할하게 하기 위해 숫자로 변환할 필요가 있다.
#include <windows.h>
#include <WinNls.h>
int getUserLocale()
{
char str_result[255];
int iRet = GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT,
LOCALE_ILANGUAGE,
(LPWSTR)str_result,
sizeof(str_result)
);
if (iRet == 0)
{
printf(" error code = %d", GetLastError());
}
//[todo] need to change to result from str_result
return result;
}
또는 더 쉬운 방법 (아래처럼 한줄로~ 이게 더 쉽다... ) ㅠ.ㅠ;
langid = PRIMARYLANGID(GetUserDefaultLangID());
참고 정보
https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getlocaleinfoex
https://learn.microsoft.com/en-us/windows/win32/intl/locale-ilanguage
반응형
'Development > Visual C++' 카테고리의 다른 글
[C++] POSIX Thread 라이브러리 사용하기 (0) | 2024.02.15 |
---|---|
[MFC] 어플리케이션 관리자 모드 실행 설정 (0) | 2023.07.31 |
fatal error C1189: #error: "No Target Architecture" (0) | 2023.04.07 |
[MFC] 다국어 RC 제작 방법 (0) | 2023.01.20 |
std variant can not found 오류 시 (0) | 2022.12.23 |
댓글