How to find world region (or country) or language from the windows registry?

旧街凉风 提交于 2020-01-05 09:36:30

问题


I'm working with a very old installer that can read Registry entries but has a difficulty (complex) time executing Windows APIs.

I'm trying to detect whether the PC it's being installed on is in Australia.

Any ideas?


回答1:


This key:

HKEY_USERS.DEFAULT\Keyboard Layout\Preload

sets the default language for the login screen

The different country codes are listed here:

http://www.windowsitpro.com/Article/ArticleID/14867/14867.html




回答2:


From my testing and the MSDN page below, this will work:

HKEY_CURRENT_USER\Control Panel\International\sCountry ="Australia"

This corresponds to setting in the Region Options ("Select an item to match it' preferences".

http://support.microsoft.com/kb/102978

This has the advantage of also being able to be read from a non-admin account.




回答3:


To supplement: "HKEY_CURRENT_USER\Control Panel\International\sCountry" is only used for the notation format. You could also use. "HKEY_CURRENT_USER\Control Panel\International\Locale" and link it to a table.

The notation cross-table:

https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx https://www.science.co.il/language/Locale-codes.php

The current location is stored in "HKEY_CURRENT_USER\Control Panel\International\Geo\Nation"

The location cross-table:

https://msdn.microsoft.com/en-us/library/windows/desktop/dd374073%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396



来源:https://stackoverflow.com/questions/778981/how-to-find-world-region-or-country-or-language-from-the-windows-registry

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!