#include <windows.h>
#include <iostream>
#include <tchar.h>
int main()
{
_wsetlocale(LC_ALL, _T("Korean"));
wchar_t strText[MAX_PATH] = { 0, };
HINSTANCE hLanguageDll = nullptr;
LANGID wLanguageID = 0;
// OS의 언어 ID를 가져온다.
wLanguageID = GetUserDefaultUILanguage();
//wLanguageID = 0x412; // 한글
//wLanguageID = 0x409; // 영어
switch (wLanguageID)
{
case 0x409 : // 영어
hLanguageDll = LoadLibrary(_T("Language_Eng"));
break;
case 0x412 : // 한글
hLanguageDll = LoadLibrary(_T("Language_Kor"));
break;
}
if (hLanguageDll == nullptr)
return -1;
LoadString(hLanguageDll, 101, strText, MAX_PATH);
wprintf(L"%s \r\n", strText);
FreeLibrary(hLanguageDll);
getchar();
return 0;
}
LANGID : https://msdn.microsoft.com/ko-kr/library/bb165625(v=vs.90).aspx
Display name | Value | Default charset |
---|---|---|
Arabic | 1025 | Arabic |
Basque | 1069 | ANSI |
Catalan | 1027 | ANSI |
Chinese (Simplified) | 2052 | GB2312 |
Chinese (Traditional) | 1028 | Chinese-Big 5 |
Czech | 1029 | Eastern European |
Danish | 1030 | ANSI |
Dutch | 1043 | ANSI |
English (United States) | 1033 | ANSI |
Finnish | 1035 | ANSI |
French | 1036 | ANSI |
German | 1031 | ANSI |
Greek | 1032 | Greek |
Hebrew | 1037 | Hebrew |
Hungarian | 1038 | Eastern European |
Italian | 1040 | ANSI |
Japanese | 1041 | Shift-JIS |
Korean | 1042 | Johab |
Norwegian | 1044 | ANSI |
Polish | 1045 | Eastern European |
Portuguese | 2070 | ANSI |
Portuguese (Brazil) | 1046 | ANSI |
Russian | 1049 | Russian |
Slovakian | 1051 | Eastern European |
Slovenian | 1060 | Eastern European |
Spanish | 3082 | ANSI |
Swedish | 1053 | ANSI |
Turkish | 1055 | Turkish |
참조 : http://copynull.tistory.com/91
'Basic Programming > Winows API' 카테고리의 다른 글
Win API - 프로그램의 실행 경로 가져오기 (0) | 2017.08.30 |
---|---|
Win API - 투명한 윈도우 만들기 (0) | 2017.04.19 |
Win API - Windows 버전을 얻어오기 (0) | 2017.02.23 |
Win API - String Table만을 이용한 다국어 (0) | 2017.02.19 |
Win API - timeBeginPeriod(), timeEndPeriod() (0) | 2017.01.16 |