开发者

Checking the regional settings

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开发者_如何学Python/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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜