Platform SDK: International Features |
The SetLocaleInfo function sets an item of locale information. This setting only affects the user override portion of the locale settings; it does not set the system defaults.
BOOL SetLocaleInfo( LCID Locale, // locale identifier LCTYPE LCType, // information type LPCTSTR lpLCData // information buffer );
If the function succeeds, the return values is a nonzero value.
If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError may return one of the following error codes:
The locale information is always passed in as a null-terminated Unicode string in the Unicode version of the function, and as a null-terminated ANSI string in the ANSI version. No integers are allowed by this function; any numeric values must be specified as Unicode or ANSI text. Each LCTYPE has a particular format, as noted in Locales. Note that several of the LCTYPE values are linked together, so that changing one changes another value as well. For more information, see Locale Information.
Only the following LCTYPE values are valid for this function:
LOCALE_ICALENDARTYPE | LOCALE_SDATE |
LOCALE_ICURRDIGITS | LOCALE_SDECIMAL |
LOCALE_ICURRENCY | LOCALE_SGROUPING |
LOCALE_IDIGITS | LOCALE_SLIST |
LOCALE_IFIRSTDAYOFWEEK | LOCALE_SLONGDATE |
LOCALE_IFIRSTWEEKOFYEAR | LOCALE_SMONDECIMALSEP |
LOCALE_ILZERO | LOCALE_SMONGROUPING |
LOCALE_IMEASURE | LOCALE_SMONTHOUSANDSEP |
LOCALE_INEGCURR | LOCALE_SNEGATIVESIGN |
LOCALE_INEGNUMBER | LOCALE_SPOSITIVESIGN |
LOCALE_IPAPERSIZE | LOCALE_SSHORTDATE |
LOCALE_ITIME | LOCALE_STHOUSAND |
LOCALE_S1159 | LOCALE_STIME |
LOCALE_S2359 | LOCALE_STIMEFORMAT |
LOCALE_SCURRENCY | LOCALE_SYEARMONTH |
Windows 2000: The ANSI version of this function will fail if it is used with a Unicode-only locale. See Language Identifiers.
Windows NT/2000: Requires Windows NT 3.5 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winnls.h; include Windows.h.
Library: Use Kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
National Language Support Overview, National Language Support Functions, GetLocaleInfo, MAKELCID