Post by Kid
How can I detect Windows system language or codepage by Win32 or MFC ?
It depends what you mean by "system language"
For each you have the option to get them in a numeric form
(LCID, used all the way to XP) or string (starting with Vista)
You can also get a language ID (LANGID), but it might not be enough
for all operations (a locale is usualy a better choice).
The language in which the UI was localized at install time?
GetSystemDefaultUILanguage -> LANGID
The language in which the UI is displayed right now?
(might be different than the system UI language if you have a MUI or LIP)
GetUserDefaultUILanguage -> LANGID
The system locale (that determines the ANSI and OEM code pages)?
GetSystemDefaultLocaleName -> string
GetSystemDefaultLCID -> LCID
GetSystemDefaultLangID -> LANGID
The locale used for locale-sensitive operations
(number/currency/date/time formatting, sorting, case conversion)?
GetUserDefaultLocaleName -> string
GetUserDefaultLCID -> LCID
GetUserDefaultLangID -> LANGID
For system code page there are two of them:
- the ANSI code page => GetACP
- the OEM code page, used (by default) by console apps => GetOEMCP
Mihai Nita [Microsoft MVP, Visual C++]
Replace _year_ with _ to get the real email