网站首页  词典首页

请输入您要查询的函数:

 

术语 getcalendarinfo
释义 GetCalendarInfo
语法:
int GetCalendarInfo(
__in LCID Locale,
__in CALID Calendar,
__in CALTYPE CalType,
__out LPTSTR lpCalData,
__in int cchData,
__out LPDWORD lpValue
);
GetCalendarInfo功能
检索资料供标识符指定的区域设置日历。
注意:对于互操作性的原因,应用程序应更喜欢GetCalendarInfoEx功能GetCalendarInfo,因为微软是对的,而不是新的区域设置的区域设置标识符地区名称的使用迁移。任何应用程序只能在Windows Vista和以后应使用GetCalendarInfoEx运行。
参数
区域设置 [in]
区域设置标识符指定语言环境来获取日历信息。您可以使用MAKELCID宏创建一个区域设置标识符或使用下列预定义的值之一。
LOCALE_CUSTOM_DEFAULT
LOCALE_CUSTOM_UI_DEFAULT
LOCALE_CUSTOM_UNSPECIFIED
LOCALE_INVARIANT
LOCALE_SYSTEM_DEFAULT
LOCALE_USER_DEFAULT
日历 [in]
日历标识符。
CalType [in]
信息类型检索。有关更多信息,请参见日历类型的信息。
注意GetCalendarInfo只返回一个字符串,如果此参数指定CAL_IYEAROFFSETRANGE或CAL_SERASTRING。在这两个当今时代的返回情况。
CAL_USE_CP_ACP是只对有关该函数的ANSI版本。
对于CAL_NOUSEROVERRIDE,函数无视SetCalendarInfo设置的任何值,并使用当前系统默认区域设置的数据库设置。这种类型只适用于组合CAL_NOUSEROVERRIDE | CAL_ITWODIGITYEARMAX。 CAL_ITWODIGITYEARMAX是唯一的价值,能够通过SetCalendarInfo集。
lpCalData [out]
可选。缓冲区指针在此函数作为字符串检索所请求的数据。如果CAL_RETURN_NUMBER在CalType指定这个参数必须检索空。
cchData [in]
大小,以字符,在lpCalData缓冲区。应用程序可以设置为0参数来返回为日历数据缓冲区所需的大小。在这种情况下,lpCalData参数不使用。如果CAL_RETURN_NUMBER是CalType指定,cchData值必须是0。
lpValue [out]
可选。指针变量为数字接收所请求的数据。如果CAL_RETURN_NUMBER在CalType指定,lpValue不能是NULL。如果CAL_RETURN_NUMBER不CalType指定,lpValue必须为NULL。
返回值
返回的人数在lpCalData缓冲区检索字符设置为一个非零值cchData,如果成功的话。如果函数成功,cchData设置为0,CAL_RETURN_NUMBER未指定,则返回值是须持有的日历信息缓冲区的大小。如果函数成功,cchData设置为0,并CAL_RETURN_NUMBER指定,返回值是在lpValue检索到的价值,那就是,为功能或4 ANSI版本的Unicode版本2的大小。
这个函数返回0,如果没有成功。为了获得更多错误信息,应用程序可以调用GetLastError函数,可以返回以下错误代码之一:
ERROR_INSUFFICIENT_BUFFER。阿提供的缓冲区大小不够大,或者被错误地设置为NULL。
ERROR_INVALID_FLAGS。旗帜提供的值不是有效的。
ERROR_INVALID_PARAMETER。该参数值的任何无效。
备注
当此函数的ANSI版本,是使用一个Unicode只设置标识符,函数可以成功,因为操作系统使用系统代码页。然而,在字符系统代码页未定义出现在一个字符串问号(?)。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinnls.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetCalendarInfoW(Unicode)和GetCalendarInfoA(ANSI)的
参见
国家语言支持
国家语言支持功能
日历类型信息
GetCalendarInfoEx
SetCalendarInfo
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月12号
==英文原文==GetCalendarInfo Function
Retrieves information about a calendar for a locale specified by identifier.
Note For interoperability reasons, the application should prefer the GetCalendarInfoEx function to GetCalendarInfo 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 GetCalendarInfoEx .
Syntax
int GetCalendarInfo(
__in LCID Locale,
__in CALID Calendar,
__in CALTYPE CalType,
__out LPTSTR lpCalData,
__in int cchData,
__out LPDWORD lpValue
);
Parameters
Locale [in]
Locale identifier that specifies the locale for which to retrieve calendar 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
Calendar [in]
Calendar identifier .
CalType [in]
Type of information to retrieve. For more information, see Calendar Type Information .
Note GetCalendarInfo returns only one string if this parameter specifies CAL_IYEAROFFSETRANGE or CAL_SERASTRING. In both cases the current era is returned.
CAL_USE_CP_ACP is relevant only for the ANSI version of this function.
For CAL_NOUSEROVERRIDE, the function ignores any value set by SetCalendarInfo and uses the database settings for the current system default locale. This type is relevant only in the combination CAL_NOUSEROVERRIDE | CAL_ITWODIGITYEARMAX. CAL_ITWODIGITYEARMAX is the only value that can be set by SetCalendarInfo.
lpCalData [out]
Optional. Pointer to a buffer in which this function retrieves the requested data as a string. If CAL_RETURN_NUMBER is specified in CalType, this parameter must retrieve NULL.
cchData [in]
Size, in characters, of the lpCalData buffer. The application can set this parameter to 0 to return the required size for the calendar data buffer. In this case, the lpCalData parameter is not used. If CAL_RETURN_NUMBER is specified for CalType, the value of cchData must be 0.
lpValue [out]
Optional. Pointer to a variable that receives the requested data as a number. If CAL_RETURN_NUMBER is specified in CalType, then lpValue must not be NULL. If CAL_RETURN_NUMBER is not specified in CalType, then lpValue must be NULL.
Return Value
Returns the number of characters retrieved in the lpCalData buffer, with cchData set to a nonzero value, if successful. If the function succeeds, cchData is set to 0, and CAL_RETURN_NUMBER is not specified, the return value is the size of the buffer required to hold the calendar information. If the function succeeds, cchData is set 0, and CAL_RETURN_NUMBER is specified, the return value is the size of the value retrieved in lpValue, that is, 2 for the Unicode version of the function or 4 for the ANSI version.
This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError , which can return one of the following error codes:
ERROR_INSUFFICIENT_BUFFER. A supplied buffer size was not large enough, or it was incorrectly set to NULL.
ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
Remarks
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 namesGetCalendarInfoW (Unicode) and GetCalendarInfoA (ANSI)
See Also
National Language Support
National Language Support Functions
Calendar Type Information
GetCalendarInfoEx
SetCalendarInfo
Send comments about this topic to Microsoft
Build date: 7/12/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd318072(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:22:41