2

In my app I need to check if the regional settings are russian on the computer it's running on. Also, I need to know if russian keyboard layout is installed.

The intention behind this is to know whether this computer is likely (I don't need to be 100% sure, likely is good enough) to be owned by a russian. The idea is to check if the regional settings are set to russian, and/or if there is a russian keyboard layout installed, as those are both likely to be present in a computer owned by a russian, but unlikely to be present on a computer owned, say, by an american.

Btw it's not really about russian, it's other nationalities I'll check for, I was just using it as an example.

How can I check those?

sashoalm
  • 75,001
  • 122
  • 434
  • 781
  • Possible dup: http://stackoverflow.com/questions/1322578/win32-api-for-getting-the-languagelocalization-info-of-the-os – dwo Apr 12 '11 at 08:31
  • Could you give us a better indication for the reasoning behind it? For instance, does a GeoIP-based solution make sense for you? Looking at my russian colleagues, I can't see any of them with a russian keyboard. – MSalters Apr 12 '11 at 11:16
  • @msalters What is GeoIP exactly? I tried a cursory search in google but it didn't turn up anything useful. – sashoalm Apr 12 '11 at 12:59

1 Answers1

2

National Language Support Functions is a good place to start.

You need to decide which info you want - You can check which locales are existing, installed, system default, user default or active for a thread. GetThreadLocale will tell you the active locale for a thread, GetUserDefaultLCID and GetSystemDefaultLCID will tell you defaults, the EnumSystemLocales function will let you see which locales exist/are installed, or you can use IsValidLocale to check if a specific locale is installed.

Erik
  • 88,732
  • 13
  • 198
  • 189