IsValidLocale function (winnls.h)
[IsValidLocale is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use IsValidLocaleName to determine the validity of a supplemental locale.]
Determines if the specified locale is installed or supported on the operating system. For more information, see Locales and Languages.
Syntax
BOOL IsValidLocale(
[in] LCID Locale,
[in] DWORD dwFlags
);
Parameters
[in] Locale
Locale identifier of the locale to validate. You can use the MAKELCID macro to create a locale identifier or use one of the following predefined values.
- LOCALE_CUSTOM_DEFAULT Windows Server 2003, Windows XP and Windows 2000: This locale identifier is not supported.
- LOCALE_CUSTOM_UI_DEFAULT Windows Server 2003, Windows XP and Windows 2000: This locale identifier is not supported.
- LOCALE_CUSTOM_UNSPECIFIED Windows Server 2003, Windows XP and Windows 2000: This locale identifier is not supported.
- LOCALE_INVARIANT
- LOCALE_SYSTEM_DEFAULT
- LOCALE_USER_DEFAULT
[in] dwFlags
Flag specifying the validity test to apply to the locale identifier. This parameter can have one of the following values.
Return value
Returns a nonzero value if the locale identifier passes the specified validity test. The function returns 0 if it does not succeed.
Remarks
If the LCID_INSTALLED flag is specified and this function returns a nonzero value, the locale identifier is both supported and installed on the operating system. Having an identifier installed implies that the full level of language support is available for the indicated locale. Full support includes code page translation tables, keyboard layouts, fonts, and sorting and locale data.
If LCID_SUPPORTED is specified and this function returns 0, the locale identifier is supported in the release, but not necessarily installed on the operating system.
This function can handle data from custom locales. Data is not guaranteed to be the same from computer to computer or between runs of an application. If your application must persist or transmit data, see Using Persistent Locale Data.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | winnls.h (include Windows.h) |
Library | Kernel32.lib |
DLL | Kernel32.dll |