网站首页  词典首页

请输入您要查询的函数:

 

术语 enumdateformats
释义 EnumDateFormats
语法:
BOOL EnumDateFormats(
__in DATEFMT_ENUMPROC lpDateFmtEnumProc,
__in LCID Locale,
__in DWORD dwFlags
);
EnumDateFormats功能
枚举长日期,短日期,或年/月的格式通常是一个指定的地点提供。
注意:要获得除了日历日期格式的信息识别,应用程序应该使用EnumDateFormatsEx功能。另一个更喜欢这个功能的原因是,微软正在朝着新的,而不是区域设置的区域设置标识符迁移地区名称的使用,互操作性的原因。
注意:任何将只能在Windows Vista或更高版本,应优先使用EnumDateFormatsExEx的EnumDateFormats运行应用程序。
参数
lpDateFmtEnumProc [in]
指向一个应用程序定义的回调函数。有关更多信息,请参阅EnumDateFormatsProc。
区域设置 [in]
区域设置标识符指定语言环境的日期格式检索信息。您可以使用MAKELCID宏以创建一个标识符或者使用下列预定义的值之一。
LOCALE_CUSTOM_DEFAULT
LOCALE_CUSTOM_UI_DEFAULT
LOCALE_CUSTOM_UNSPECIFIED
LOCALE_INVARIANT
LOCALE_SYSTEM_DEFAULT
LOCALE_USER_DEFAULT
dwFlags [in]
旗指定日期格式。应用程序可以提供下列值或LOCALE_USE_CP_ACP永恒的。
ValueMeaning
DATE_SHORTDATEUse短日期格式。此值不能用于DATE_LONGDATE或DATE_YEARMONTH。
DATE_LONGDATEUse长日期格式。此值不能用于DATE_SHORTDATE或DATE_YEARMONTH。
DATE_YEARMONTHUse年/月格式。此值不能用于DATE_SHORTDATE或DATE_LONGDATE。
返回值
返回一个非零值如果成功,或否则为0。为了获得更多错误信息,应用程序可以调用GetLastError函数,可以返回以下错误代码之一:
ERROR_INVALID_FLAGS。旗帜提供的值不是有效的。
ERROR_INVALID_PARAMETER。该参数值的任何无效。
备注
枚举函数传递的日期格式字符串指针,一次一个,到指定的应用程序的日期格式定义的回调函数。这个过程一直持续到EnumDateFormats找到的最后日期格式或回调函数返回FALSE。
这个函数枚举指定区域的所有更新,包括备用日历格式,如果有的话。然而,日历标识符不枚举随着日期格式,使日历与其他区域设置格式难以利用。
注意:要枚举日历与其他区域设置的日期格式,应用程序应该使用EnumDateFormatsEx。
这个功能可以自定义区域设置枚举数据。数据不能保证从同一计算机到计算机之间或应用程序的运行。如果应用程序必须坚持或传输数据,请参阅使用持久性本地化数据。
当此函数的ANSI版本,是使用一个Unicode只设置标识符,函数可以成功,因为操作系统使用系统代码页。然而,在字符系统代码页未定义出现在一个字符串问号(?)。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinnls.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesEnumDateFormatsW(Unicode)和EnumDateFormatsA(ANSI)的
参见
国家语言支持
国家语言支持功能
EnumDateFormatsEx
EnumDateFormatsExEx
EnumDateFormatsProc
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月12号
==英文原文==EnumDateFormats Function
Enumerates the long date, short date, or year/month formats that are available for a specified locale.
Note To receive a calendar identifier in addition to date format information, the application should use the EnumDateFormatsEx function. Another reason for preferring this function is that Microsoft is migrating toward the use of locale names instead of locale identifiers for new locales, for interoperability reasons.
Note Any application that will be run only on Windows Vista or later should use EnumDateFormatsExEx in preference to EnumDateFormats.
Syntax
BOOL EnumDateFormats(
__in DATEFMT_ENUMPROC lpDateFmtEnumProc,
__in LCID Locale,
__in DWORD dwFlags
);
Parameters
lpDateFmtEnumProc [in]
Pointer to an application-defined callback function. For more information, see EnumDateFormatsProc .
Locale [in]
Locale identifier that specifies the locale for which to retrieve date format information. You can use the MAKELCID macro to create an identifier or use one of the following predefined values.
LOCALE_CUSTOM_DEFAULT
LOCALE_CUSTOM_UI_DEFAULT
LOCALE_CUSTOM_UNSPECIFIED
LOCALE_INVARIANT
LOCALE_SYSTEM_DEFAULT
LOCALE_USER_DEFAULT
dwFlags [in]
Flag specifying date formats. The application can supply one of the following values or the LOCALE_USE_CP_ACP constant.
ValueMeaning
DATE_SHORTDATEUse short date formats. This value cannot be used with DATE_LONGDATE or DATE_YEARMONTH.
DATE_LONGDATEUse long date formats. This value cannot be used with DATE_SHORTDATE or DATE_YEARMONTH.
DATE_YEARMONTHUse year/month formats. This value cannot be used with DATE_SHORTDATE or DATE_LONGDATE.

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_INVALID_FLAGS. The values supplied for flags were not valid.
ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
Remarks
The function enumerates the date formats by passing date format string pointers, one at a time, to the specified application-defined callback function. This process continues until EnumDateFormats finds the last date format or the callback function returns FALSE.
This function enumerates all date formats for the specified locale, including alternate calendars, if any. However, the calendar identifier is not enumerated along with the date format, making formats for locales with alternate calendars difficult to use.
Note To enumerate the date formats for locales with alternate calendars, the application should use EnumDateFormatsEx .
This function can enumerate data from custom locales . Data is not guaranteed to be the same from computer to computer or between runs of an application. If your application must persist or transmit data, see Using Persistent Locale Data .
When the ANSI version of this function is used with a Unicode-only locale identifier, the function can succeed because the operating system uses the system code page. However, characters that are undefined in the system code page appear in the string as a question mark (?).
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinnls.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesEnumDateFormatsW (Unicode) and EnumDateFormatsA (ANSI)
See Also
National Language Support
National Language Support Functions
EnumDateFormatsEx
EnumDateFormatsExEx
EnumDateFormatsProc
Send comments about this topic to Microsoft
Build date: 7/12/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd317810(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:31:02