How to get current country name on Windows 95, NT 3.51
I want to get current country code for oldes开发者_运维知识库t Windows systems.
I was using GetLocaleInfo() with LOCALE_ICOUNTRY flag, but then I've realized it returns wrong results (the same values for different countries), so I've tried LOCALE_SISO3166CTRYNAME which returns country code in ISO3166 standard 2 letters code (eg. 'US')
http://www.iso.org/iso/english_country_names_and_code_elements
...it works fine, but not on the oldest Windows versions.
So my question is, how to get valid country code (identifier, name, whatever...) on Windows 95 / NT 3.51?
I'm not entirely sure if it applies in your case, but there was a bug in the old (pre 1.25A) versions of Win32S where GetLocaleInfo() would return incorrect information for most non-US locales. (See: w32s125a.txt).
I find it likely that this bug might also have been present in early Win95 and NT 3.51.
I'm way curious to know why you would be writing code for such ancient operating systems though!
精彩评论