Microsoft Knowledge Base

Identifying the Versions of International Windows

Last reviewed: October 17, 1996
Article ID: Q130062
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1
  • Microsoft Win32s version 1.2

SUMMARY

This article suggests three ways to check for the language used in an international version of a Windows-based application.

MORE INFORMATION

Option One: Least Coding and Least Accurate

Check the "sCountry" entry under the [intl] section of the WIN.INI file by using the GetProfileString API. It is likely that this will match the Windows language version. For example, German Windows will probably have "Deutchland" and English Windows will probably have "United States" or "United Kingdom." However, because the user can change this setting by using the Control Panel, it is not always accurate.

Option Two: Most Coding and Most Accurate

Check the "deflang" entry under the [data] section of the SETUP.INF file. This is a three-letter language code that SETUP.EXE uses. The setting will be one of these:

  English=ENU or ENG
  Spanish=ESP
  German=DEU
  French=FRA or FRC (French Canadian)
  Italian=ITA

The problem with this method is getting at the "deflang" entry in the SETUP.INF file. The applications should parse SETUP.INF. It's not that difficult, but it does involve extra coding.

Option Three: Let the User Choose

Suggest to the user what the application found, and let the user make final decision. Here's the algorithm:

   if Windows Version < 3.1
           Look at Win.ini, Setup.inf files
           Suggest a good guess and let the user choose;
           Register a profile string for your app;
   else
           Use version stamping;

For Windows version 3.1, the way to identify the character set is to use the version stamping API. The translation value from the GetFileVersionInfo when performed on GDI or SHELL.DLL is the only way in version 3.1 to find out the character set of the system. Please refer to the SDK documentation for more details on this API. Look for both GetFileVersionInfo and VERSIONINFO.

The VERSIONINFO statement creates a version-information resource. The resource contains information about the file such as its version number, its intended operating system, and its original filename. One of the parameters is langID, which specifies the language identifiers.


Additional reference words: 1.20 3.10
KBCategory: kbother kbhowto
KBSubcategory: wintldev


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 17, 1996
©1997 Microsoft Corporation. All rights reserved. Legal Notices.