Get current location value in Regional language settings in C ++

Want to extract the name of the country from the control panel → region and language-> location current location

I tried the following win32 function GetLocaleInfo (returns culture) GetSystemDefaultLCID (returns language). Also looked at GetGeoInfo

but cannot extract the name of the country. Hope I clearly understand my question.

+4
source share
1 answer

Its available:

  • Get a GEOID by calling GetUserGeoID() with GEOCLASS_NATION
  • Pass the GEOID to GetGeoInfo() along with GEO_FRIENDLYNAME to retrieve a string in the language specified in LangId ( GetUserDefaultLCID() for the current)
+2
source

Source: https://habr.com/ru/post/1437838/


All Articles