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.

EnumSystemLocalesEx function

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

Note  The application should call this function in preference to EnumSystemLocales if designed to run only on Windows Vista and later.


BOOL EnumSystemLocalesEx(
  _In_     LOCALE_ENUMPROCEX lpLocaleEnumProcEx,
  _In_     DWORD             dwFlags,
  _In_     LPARAM            lParam,
  _In_opt_ LPVOID            lpReserved


lpLocaleEnumProcEx [in]

Pointer to an application-defined callback function. The EnumSystemLocalesEx function enumerates locales by making repeated calls to this callback function. For more information, see EnumLocalesProcEx.

dwFlags [in]

Flags identifying the locales 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 LOCALE_ALL.

lParam [in]

An application-provided parameter to be passed to the callback function. This is especially useful for multi-threaded applications.

lpReserved [in, optional]

Reserved; must be NULL.

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.


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

The choices for the dwFlags parameter are different from those for EnumSystemLocales, which must distinguish between installed and supported locales.

If dwFlags specifies LOCALE_ALTERNATE_SORTS, the callback function is called for every locale that represents an alternate sort order. For example, Spanish (Spain) defaults to international sort order, but traditional sort order is available for an alternate sort. German (Germany) defaults to dictionary sort order, but there is an alternate phone book sort order available.


An example showing the use of this function can be found in NLS: Name-based APIs Sample.


Minimum supported client

Windows Vista [desktop apps | UWP apps]

Minimum supported server

Windows Server 2008 [desktop apps | UWP apps]


Winnls.h (include Windows.h)





See also

National Language Support
National Language Support Functions



© 2018 Microsoft