网站首页  词典首页

请输入您要查询的函数:

 

术语 enumtimeformats
释义 EnumTimeFormats
语法:
BOOL EnumTimeFormats(
__in TIMEFMT_ENUMPROC lpTimeFmtEnumProc,
__in LCID Locale,
__in DWORD dwFlags
);
EnumTimeFormats功能
枚举的时间格式是由标识符指定的区域设置可用。
注意:对于互操作性的原因,应用程序应更喜欢EnumTimeFormatsEx功能EnumTimeFormats,因为微软是对的,而不是新的区域设置的区域设置标识符地区名称的使用迁移。任何应用程序只能在Windows Vista和以后应使用EnumTimeFormatsEx运行。
参数
lpTimeFmtEnumProc [in]
指向一个应用程序定义的回调函数。有关更多信息,请参阅EnumTimeFormatsProc。
区域设置 [in]
区域设置标识符指定语言环境来获取时间格式的信息。您可以使用MAKELCID宏创建一个区域设置标识符或使用下列预定义的值之一。
LOCALE_CUSTOM_DEFAULT
LOCALE_CUSTOM_UI_DEFAULT
LOCALE_CUSTOM_UNSPECIFIED
LOCALE_INVARIANT
LOCALE_SYSTEM_DEFAULT
LOCALE_USER_DEFAULT
dwFlags [in]
时间格式。设置为0使用当前用户的长时间格式或TIME_NOSECONDS使用短的时间格式。 When using the EnumTimeFormatsA method (not recommended), you can combine this flag with the LOCAL_USE_CP_ACP flag to use the system default Windows ANSI code page (ACP) instead of the locale code page.
返回值
返回一个非零值如果成功,或否则为0。为了获得更多错误信息,应用程序可以调用GetLastError函数,可以返回以下错误代码之一:
ERROR_INVALID_FLAGS。旗帜提供的值不是有效的。
ERROR_INVALID_PARAMETER。该参数值的任何无效。
备注
枚举函数传递一个指向缓冲时间格式包含一个应用程序定义的回调函数的时间格式。枚举中的第一个值始终是用户的默认(覆盖)的价值。该函数继续进行,直到最后一次发现或格式的回调函数返回FALSE枚举。
这个功能可以自定义区域设置枚举数据。数据不能保证从同一计算机到计算机之间或应用程序的运行。如果应用程序必须坚持或传输数据,请参阅使用持久性本地化数据。
当此函数的ANSI版本是使用Unicode的唯一区域识别,呼叫可以成功,因为系统使用系统代码页。然而,在字符系统代码页未定义出现在一个问号("?").串请注意,在未来推出不能与ANSI版本dwFlags任何新的价值。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinnls.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesEnumTimeFormatsW(Unicode)和EnumTimeFormatsA(ANSI)的
参见
国家语言支持
国家语言支持功能
EnumTimeFormatsEx
EnumTimeFormatsProc
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月12号
==英文原文==EnumTimeFormats Function
Enumerates the time formats that are available for a locale specified by identifier.
Note For interoperability reasons, the application should prefer the EnumTimeFormatsEx function to EnumTimeFormats because Microsoft is migrating toward the use of locale names instead of locale identifiers for new locales. Any application that runs only on Windows Vista and later should use EnumTimeFormatsEx .
Syntax
BOOL EnumTimeFormats(
__in TIMEFMT_ENUMPROC lpTimeFmtEnumProc,
__in LCID Locale,
__in DWORD dwFlags
);
Parameters
lpTimeFmtEnumProc [in]
Pointer to an application-defined callback function. For more information, see EnumTimeFormatsProc .
Locale [in]
Locale identifier that specifies the locale for which to retrieve time format information. You can use the MAKELCID macro to create a locale 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]
The time format. Set to 0 to use the current user's long time format or to TIME_NOSECONDS to use the short time format. When using the EnumTimeFormatsA method (not recommended), you can combine this flag with the LOCAL_USE_CP_ACP flag to use the system default Windows ANSI code page (ACP) instead of the locale code page.
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 time formats by passing a pointer to a buffer containing a time format to an application-defined callback function. The first value in the enumeration is always the user default (override) value. The function continues enumeration until the last time format is found or the callback function returns FALSE.
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 call can succeed because the system uses the system code page. However, characters that are undefined in the system code page appear in the string as a question mark ("?"). Note that any new values for dwFlags introduced in the future will not work with the ANSI version.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinnls.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesEnumTimeFormatsW (Unicode) and EnumTimeFormatsA (ANSI)
See Also
National Language Support
National Language Support Functions
EnumTimeFormatsEx
EnumTimeFormatsProc
Send comments about this topic to Microsoft
Build date: 7/12/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd317830(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 13:16:17