Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

EnumSystemLocales function

Enumerates the locales that are either installed on or supported by an operating system.

Note  For interoperability reasons, the application should prefer the EnumSystemLocalesEx function to EnumSystemLocales because Microsoft is migrating toward the use of locale names instead of locale identifiers for new locales. Any application that will be run only on Windows Vista and later should use EnumSystemLocalesEx.


BOOL EnumSystemLocales(
  _In_ LOCALE_ENUMPROC lpLocaleEnumProc,
  _In_ DWORD           dwFlags


lpLocaleEnumProc [in]

Pointer to an application-defined callback function. For more information, see EnumLocalesProc.

dwFlags [in]

Flags specifying the locale identifiers to enumerate. The flags can be used singly or combined using a binary OR. If the application specifies 0 for this parameter, the function behaves as for LCID_SUPPORTED.


Enumerate only installed locale identifiers. This value cannot be used with LCID_SUPPORTED.


Enumerate all supported locale identifiers. This value cannot be used with LCID_INSTALLED.


Enumerate only the alternate sort locale identifiers. If this value is used with either LCID_INSTALLED or LCID_SUPPORTED, the installed or supported locales are retrieved, as well as the alternate sort locale identifiers.


Return value

Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can return one of the following error codes:

  • ERROR_BADDB. The function could not access the data. This situation should not normally occur, and typically indicates a bad installation, a disk problem, or the like.
  • ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
  • ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.


The function enumerates locales by passing locale identifiers, one at a time, to the specified application-defined callback function. This continues until all of the installed or supported locale identifiers have been passed to the callback function or the callback function returns FALSE.


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]


Winnls.h (include Windows.h)





Unicode and ANSI names

EnumSystemLocalesW (Unicode) and EnumSystemLocalesA (ANSI)

See also

National Language Support
National Language Support Functions



© 2018 Microsoft