EnumDateFormatsExEx

Enumerates the long date, short date, or year/month formats that are available for a locale specified by name.

Note

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

This function can enumerate data that changes between releases, for example, due to a custom locale. If your application must persist or transmit data, see Using Persistent Locale Data.

Syntax

BOOL EnumDateFormatsExEx(
         DATEFMT_ENUMPROCEXEX lpDateFmtEnumProcExEx,
         LPCWSTR lpLocaleName,
         DWORD dwFlags,
         LPARAM lParam
)  

Parameters

lpDateFmtEnumProcExEx
Type: DATEFMT_ENUMPROCEXEX 

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

lpLocaleName
Type: LPCWSTR 

Pointer to a locale name, or one of the following predefined values.

dwFlags
Type: DWORD 

Flag specifying date formats. The application can supply one of the following values or the LOCALE_USE_CP_ACP constant.

lParam
Type: LPARAM 

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

Return value

Type: BOOL 

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:

Remarks

The function enumerates the date formats by passing date format string pointers, one at a time, to the specified application-defined callback function, along with an application-defined constant that is useful for multi-threaded applications. This process continues until EnumDateFormatsExEx finds the last date format or the callback function returns FALSE.

Beginning in Windows 8: If your app passes language tags to this function from the Windows.Globalization namespace, it must first convert the tags by calling ResolveLocaleName.

Requirements

Header: Declared in winnls.h.

Library: Use kernelx.lib.