Skip to main content

Windows 2000 and Windows XP Language-Specific APIs

This article lists the language-specific APIs available in Windows 2000 and Windows 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

LANGID GetSystemDefaultUILanguage()

The GetSystemDefaultUILanguage function retrieves the LANGID for the original install language of the system.

Return Value

  • 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.

See Also

Top of pageTop of page

LANGID GetUserDefaultUILanguage

The GetUserDefaultUILanguage function retrieves the LANGID for the current user's UI language selection.

Return Value

  • 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.

See Also

Top of pageTop of page

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.

Parameters

lpUILanguageEnumProc

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.

dwFlags

Reserved. Must be zero.

lParam

Specifies an application–defined value passed to the callback function. This parameter may be used in error checking.

Return Value

  • 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

See Also

Top of pageTop of page

EnumUILanguagesProc

                                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.

Parameters

lpUILanguageString

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.

lParam

Specifies the application-defined parameter passed to the EnumUILanguages function. This parameter can be used in error checking.

Return Value

  • To continue enumeration, the callback function should return TRUE.

  • To stop enumeration, the callback function should return FALSE.

Remarks

  • 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.

See Also

 

Top of pageTop of page

IsValidLanguageGroup

                                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.

Parameters

LanguageGroup

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

dwFlags

Specifies the validity test to apply to the language group identifier. This parameter can be one of the following values:

Value Meaning
  • LGRPID_INSTALLED Test whether the language group identifier is both supported and installed.
  • LGRPID_SUPPORTED Test whether the language group identifier is supported.

Return Value

  • 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.

Remarks

  • 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.

See Also

Top of pageTop of page

EnumSystemLanguageGroups

                                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.

Parameters

lpLanguageGroupEnumProc

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.

dwFlags

Specifies the language group identifiers to enumerate. This parameter can be one of the following values:

Value Meaning
  • LGRPID_INSTALLED Enumerate only installed language group identifiers.
  • LGRPID_SUPPORTED Enumerate all supported language group identifiers.

lParam

Specifies an application-defined value passed to the callback function. This parameter may be used in error checking.

Return Value

  • 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

See Also

 

Top of pageTop of page

EnumSystemLanguageGroupsProc

                                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.

Parameters

LanguageGroup

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

lpLanguageGroupString

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.

lpLanguageGroupNameString

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.

dwFlags

Specifies whether the language group identifier is supported or installed. This parameter can be one of the following values:

Value Meaning
  • LGRPID_INSTALLED Language group identifier is installed.

  • LGRPID_SUPPORTED Language group identifier is both supported and installed.

lParam

Specifies the application–defined parameter passed to the EnumSystemLanguageGroups function. This parameter can be used in error checking.

Return Value

  • To continue enumeration, the callback function should return TRUE.

  • To stop enumeration, the callback function should return FALSE.

Remarks

  • 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

See Also

 

Top of pageTop of page

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.

Parameters

lpLangGroupLocaleEnumProc

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.

LanguageGroup

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

dwFlags

Reserved. Must be zero.

lParam

Specifies an application–defined value passed to the callback function. This parameter may be used in error checking.

Return Value

  • 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

See Also

 

Top of pageTop of page

EnumLanguageGroupLocalesProc

                                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.

Parameters

LanguageGroup

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

Locale

Specifies the locale identifier.

lpLocaleString

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.

lParam

Specifies the application–defined parameter passed to the EnumLanguageGroupLocales function. This parameter can be used in error checking.

Return Value

  • To continue enumeration, the callback function should return TRUE.

  • To stop enumeration, the callback function should return FALSE.

Remarks

  • 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.

See Also

 

Top of pageTop of page