Although not strictly an FAQ, this page lists the new language–specific APIs available in Windows 2000 and XP.
GetSystemDefaultUILanguage to get the original language of the system
GetUserDefaultUILanguage to get the user's selection
EnumUILanguages to see what's languages are available
IsValidLanguageGroup to check if a language group is installed or supported
EnumSystemLanguageGroups to list which language group is installed or supported
EnumLanguageGroupLocales to list all suppored locales within one language group
The GetSystemDefaultUILanguage function retrieves the LANGID for the original install language of the system.
| • | If the function succeeds, the return value is the LANGID for the system default UI language. |
| • | If the function fails, the return value is 0. |
| • | GetUserDefaultUILanguage |
| • | EnumUILanguages |
The GetUserDefaultUILanguage function retrieves the LANGID for the current user's UI language selection.
| • | If the function succeeds, the return value is the LANGID for the current user's UI language. |
| • | If the function fails, the return value is 0. |
| • | GetSystemDefaultUILanguage |
| • | EnumUILanguages |
BOOL EnumUILanguages( UILANGUAGE_ENUMPROC lpUILanguageEnumProc, // pointer to enumeration callback function DWORD dwFlags, // flags - reserved LONG_PTR lParam, // application-defined parameter );
The EnumUILanguages function enumerates the UI languages that are available on the system. The value of the dwFlags parameter must be zero. The function enumerates the UI languages by passing language identifiers, one at a time, to the specified application-defined callback function. This continues until the last language identifer is found or the callback function returns FALSE.
Points to an application-defined callback function. The EnumUILanguages function enumerates language identifiers by making repeated calls to this callback function. For more information, see the EnumUILanguagesProc callback function.
Reserved. Must be zero.
Specifies an application–defined value passed to the callback function. This parameter may be used in error checking.
| • | If the function succeeds, the return value is TRUE. |
| • | If the function fails, the return value is FALSE. To get extended error information, call GetLastError |
May return one of the following error codes:
| • | ERROR_BADDB |
| • | ERROR_INVALID_PARAMETER |
| • | ERROR_INVALID FLAGS |
| • | EnumUILanguagesProc |
| • | GetSystemDefaultUILanguage |
| • | GetUserDefaultUILanguage |
BOOL CALLBACK EnumUILanguagesProc ( LPTSTR lpUILanguageString // pointer to UI language string LONG_PTR lParam // application-defined parameter );
An EnumUILanguagesProc function is an application-defined callback function. It is called as a result of a call to the EnumUILanguages function, and receives a pointer to a string buffer containing a UI language identifier, and the application-defined parameter passed to EnumUILanguages.
Pointer to a string buffer containing a null–terminated UI language identifier string. Note that lpUILanguageString should be an LPWSTR for the Unicode (W) version of EnumUILanguagesProc, and an LPSTR for the ANSI (A) version of EnumUILanguagesProc.
Specifies the application-defined parameter passed to the EnumUILanguages function. This parameter can be used in error checking.
| • | To continue enumeration, the callback function should return TRUE. |
| • | To stop enumeration, the callback function should return FALSE. |
| • | EnumUILanguagesProc is a placeholder for an application-defined function name. |
| • | An EnumUILanguagesProc function can carry out any desired task. |
| • | An application registers an EnumUILanguagesProc function by passing its address to the EnumUILanguages function. |
| • | A value of type UILANGUAGE_ENUMPROC is a pointer to an EnumUILanguagesProc function. |
| • | EnumUILanguages |
BOOL IsValidLanguageGroup( LGRPID LanguageGroup, // language group identifier to validate DWORD dwFlags // specifies validity test );
The IsValidLanguageGroup applies a validity test to a language group identifier. The dwFlags parameter determines the nature of the validity test. Currently, the function tests whether a language group identifier is installed or supported on the calling system.
Specifies the language group identifier to be validated. This parameter can be one of the following values:
| • | LGRPID_WESTERN_EUROPE |
| • | LGRPID_CENTRAL_EUROPE |
| • | LGRPID_BALTIC |
| • | LGRPID_GREEK |
| • | LGRPID_CYRILLIC |
| • | LGRPID_TURKISH |
| • | LGRPID_JAPANESE |
| • | LGRPID_KOREAN |
| • | LGRPID_TRADITIONAL_CHINESE |
| • | LGRPID_SIMPLIFIED_CHINESE |
| • | LGRPID_THAI |
| • | LGRPID_HEBREW |
| • | LGRPID_ARABIC |
| • | LGRPID_VIETNAMESE |
| • | LGRPID_INDIC |
Specifies the validity test to apply to the language group identifier. This parameter can be one of the following values:
| • | LGRPID_INSTALLED Test whether the language group identifier is both supported and installed. |
| • | LGRPID_SUPPORTED Test whether the language group identifier is supported. |
| • | If the language group identifier passes the specified validity test, the return value is TRUE. |
| • | If the language group identifier does not pass the specified validity test, the return value is FALSE. |
| • | If the LGRPID_INSTALLED flag is specified and this function returns TRUE, the language group identifier is both supported and installed on the system. |
| • | If the LGRPID_SUPPORTED flag is specified and this function returns TRUE, the language group identifier is supported in the release, but not necessarily installed on the system. |
| • | EnumSystemLanguageGroups |
| • | EnumLanguageGroupLocales |
BOOL EnumSystemLanguageGroups( LANGUAGEGROUP_ENUMPROC lpLanguageGroupEnumProc, // pointer to enumeration callback function DWORD dwFlags // language groups to enumerate LONG_PTR lParam, // application-defined parameter );
The EnumSystemLanguageGroups function enumerates the language groups that are either installed on or supported by a system. The dwFlags parameter determines whether the function enumerates installed or supported system language groups. The function enumerates language groups by passing language group identifiers, one at a time, to the specified application-defined callback function. This continues until the last language group identifer is found or the callback function returns FALSE.
Points to an application-defined callback function. The EnumSystemLanguageGroups function enumerates language group identifiers by making repeated calls to this callback function.
For more information, see the EnumLanguageGroupsProc callback function.
Specifies the language group identifiers to enumerate. This parameter can be one of the following values:
| • | LGRPID_INSTALLED Enumerate only installed language group identifiers. |
| • | LGRPID_SUPPORTED Enumerate all supported language group identifiers. |
Specifies an application-defined value passed to the callback function. This parameter may be used in error checking.
| • | If the function succeeds, the return value is TRUE. |
| • | If the function fails, the return value is FALSE. To get extended error information, call GetLastError. |
GetLastError may return one of the following error codes:
| • | ERROR_BADDB |
| • | ERROR_INVALID_PARAMETER |
| • | ERROR_INVALID FLAGS |
| • | EnumSystemLanguageGroupsProc |
| • | IsValidLanguageGroup |
| • | EnumLanguageGroupLocales |
BOOL CALLBACK EnumLanguageGroupsProc( LGRPID LanguageGroup, // language group identifier LPTSTR lpLanguageGroupString, // pointer to language group identifier string LPTSTR lpLanguageGroupNameString, // pointer to language group name string DWORD dwFlags // flags LONG_PTR lParam // application-defined parameter );
An EnumLanguageGroupsProc function is an application-defined callback function. It is called as a result of a call to the EnumSystemLanguageGroups function, and receives a language group identifier, a pointer to a string buffer containing a language group identifier, a pointer to a string buffer containing the name of the language group, a flags field, and the application–defined parameter passed to EnumSystemLanguageGroups.
Specifies the language group identifier. This parameter can be one of the following values:
| • | LGRPID_WESTERN_EUROPE |
| • | LGRPID_CENTRAL_EUROPE |
| • | LGRPID_BALTIC |
| • | LGRPID_GREEK |
| • | LGRPID_CYRILLIC |
| • | LGRPID_TURKISH |
| • | LGRPID_JAPANESE |
| • | LGRPID_KOREAN |
| • | LGRPID_TRADITIONAL_CHINESE |
| • | LGRPID_SIMPLIFIED_CHINESE |
| • | LGRPID_THAI |
| • | LGRPID_HEBREW |
| • | LGRPID_ARABIC |
| • | LGRPID_VIETNAMESE |
| • | LGRPID_INDIC |
Pointer to a string buffer containing a null–terminated language group identifier string. Note that lpLanguageGroupString should be an LPWSTR for the Unicode (W) version of EnumLanguageGroupsProc, and an LPSTR for the ANSI (A) version of EnumLanguageGroupsProc.
Pointer to a string buffer containing a null–terminated language group name string. Note that lpUILanguageString should be an LPWSTR for the Unicode (W) version of EnumLanguageGroupsProc, and an LPSTR for the ANSI (A) version of EnumLanguageGroupsProc.
Specifies whether the language group identifier is supported or installed. This parameter can be one of the following values:
| • | LGRPID_INSTALLED Language group identifier is installed. |
| • | LGRPID_SUPPORTED Language group identifier is both supported and installed. |
Specifies the application–defined parameter passed to the EnumSystemLanguageGroups function. This parameter can be used in error checking.
| • | To continue enumeration, the callback function should return TRUE. |
| • | To stop enumeration, the callback function should return FALSE. |
| • | The LGRPID_INSTALLED and LGRPID_SUPPORTED flags are mutually exclusive. |
| • | EnumLanguageGroupsProc is a placeholder for an application-defined function name. |
| • | ERROR_INVALID FLAGS |
| • | ERROR_INVALID_PARAMETER |
| • | ERROR_INVALID FLAGS |
| • | EnumLanguageGroupsProc |
| • | IsValidLanguageGroup |
| • | EnumLanguageGroupLocales |
BOOL EnumLanguageGroupLocales( LANGGROUPLOCALE_ENUMPROC lpLangGroupLocaleEnumProc, // pointer to enumeration callback function LGRPID LanguageGroup, // language group identifier DWORD dwFlags // flags – reserved LONG_PTR lParam, // application–defined parameter );
The EnumLanguageGroupLocales function enumerates the locales in a given language group. The value of the dwFlags parameter must be zero. The function enumerates the locales in a language group by passing locale identifiers, one at a time, to the specified application–defined callback function. This continues until the last locale identifer is found or the callback function returns FALSE.
Points to an application–defined callback function. The EnumLanguageGroupLocales function enumerates locale identifiers in the given language group by making repeated calls to this callback function. For more information, see the EnumLanguageGroupLocalesProc callback function.
Specifies the language group identifier to enumerate. This parameter can be one of the following values:
| • | LGRPID_WESTERN_EUROPE |
| • | LGRPID_CENTRAL_EUROPE |
| • | LGRPID_BALTIC |
| • | LGRPID_GREEK |
| • | LGRPID_CYRILLIC |
| • | LGRPID_TURKISH |
| • | LGRPID_JAPANESE |
| • | LGRPID_KOREAN |
| • | LGRPID_TRADITIONAL_CHINESE |
| • | LGRPID_SIMPLIFIED_CHINESE |
| • | LGRPID_THAI |
| • | LGRPID_HEBREW |
| • | LGRPID_ARABIC |
| • | LGRPID_VIETNAMESE |
| • | LGRPID_INDIC |
Reserved. Must be zero.
Specifies an application–defined value passed to the callback function. This parameter may be used in error checking.
| • | If the function succeeds, the return value is TRUE. |
| • | If the function fails, the return value is FALSE. To get extended error information, call GetLastError. |
May return one of the following error codes:
| • | ERROR_BADDB |
| • | ERROR_INVALID_PARAMETER |
| • | ERROR_INVALID FLAGS |
| • | EnumLanguageGroupLocalesProc |
| • | IsValidLanguageGroup |
| • | EnumSystemLanguageGroups |
CLass= api>BOOL CALLBACK EnumLanguageGroupLocalesProc( LGRPID LanguageGroup, // language group identifier LCID Locale, // locale identifier LPTSTR lpLocaleString, // pointer to locale identifier string LONG_PTR lParam // application-defined parameter );
An EnumLanguageGroupLocalesProc function is an application–defined callback function. It is called as a result of a call to the EnumLanguageGroupLocales function, and receives a language group identifier, a locale identifier, a pointer to a string buffer containing a locale and the application–defined parameter passed to EnumLanguageGroupLocales.
Specifies the language group identifier being enumerated. This parameter can be one of the following values:
| • | LGRPID_WESTERN_EUROPE |
| • | LGRPID_CENTRAL_EUROPE |
| • | LGRPID_BALTIC |
| • | LGRPID_GREEK |
| • | LGRPID_CYRILLIC |
| • | LGRPID_TURKISH |
| • | LGRPID_JAPANESE |
| • | LGRPID_KOREAN |
| • | LGRPID_TRADITIONAL_CHINESE |
| • | LGRPID_SIMPLIFIED_CHINESE |
| • | LGRPID_THAI |
| • | LGRPID_HEBREW |
| • | LGRPID_ARABIC |
| • | LGRPID_VIETNAMESE |
| • | LGRPID_INDIC |
Specifies the locale identifier.
Pointer to a string buffer containing a null–terminated locale identifier string. Note that lpLocaleString should be an LPWSTR for the Unicode (W) version of EnumLanguageGroupLocalesProc, and an LPSTR for the ANSI (A) version of EnumLanguageGroupLocalesProc.
Specifies the application–defined parameter passed to the EnumLanguageGroupLocales function. This parameter can be used in error checking.
| • | To continue enumeration, the callback function should return TRUE. |
| • | To stop enumeration, the callback function should return FALSE. |
| • | EnumLanguageGroupLocalesProc is a placeholder for an application–defined function name. |
| • | An EnumLanguageGroupLocalesProc function can carry out any desired task. |
| • | An application registers an EnumLanguageGroupLocalesProc function by passing its address to the EnumLanguageGroupLocales function. |
| • | A value of type LANGGROUPLOCALE_ENUMPROC is a pointer to an EnumLanguageGroupLocalesProc function. |
| • | EnumLanguageGroupLocales |
| • | EnumSystemLanguageGroups |