Platform SDK: International Features

EnumTimeFormats

The EnumTimeFormats function enumerates the time formats that are available for a specified locale. The function enumerates the time formats by passing a pointer to a buffer containing a time format to an application defined–callback function. It continues to do so until the last time format is found or the callback function returns FALSE.

BOOL EnumTimeFormats(
  TIMEFMT_ENUMPROC lpTimeFmtEnumProc, // callback function
  LCID Locale,                        // locale
  DWORD dwFlags                       // unused
);

Parameters

lpTimeFmtEnumProc
[in] Pointer to an application defined–callback function. For more information, see EnumTimeFormatsProc.
Locale
[in] Specifies the locale to retrieve time format information for. This parameter can be a locale identifier created by the MAKELCID macro, or by one of the following predefined values.
Value Meaning
LOCALE_SYSTEM_DEFAULT Default system locale.
LOCALE_USER_DEFAULT Default user locale.

dwFlags
[in] Currently, only the following value is defined.
Value Meaning
LOCALE_USE_CP_ACP Use the system ANSI code page for string translation instead of the locale's code page.

Return Values

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:

Remarks

Windows 2000: The ANSI version of this function will fail if it is used with a Unicode-only LCID. See Language Identifiers.

Requirements

  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.

See Also

National Language Support Overview, National Language Support Functions, EnumTimeFormatsProc, EnumCalendarInfo, EnumDateFormats