How to get OS language using C++ API?

后端 未结 3 1158
暗喜
暗喜 2021-01-03 09:00

I am in the process of developing a application which displays dialogs depending on the OS language. How I can get the OS language using C++ or Windows APIs (Windows 2008/Vi

3条回答
  •  旧时难觅i
    2021-01-03 09:41

    There are several functions to do this in Windows, depending on what format you want the information in. Prior to Windows Vista, the language information was encoded into a LCID (Locale Id) which includes language, as well as some information about sorting and formatting.

    For Windows Vista and Windows 7, a more flexible system called Locale Names was devised. GetSystemDefaultLocaleName

    Use this if you want to work on Win2k and WinXP. GetSystemDefaultLCID

提交回复
热议问题