网站首页  词典首页

请输入您要查询的函数:

 

术语 getgeoinfo
释义 GetGeoInfo
语法:
int GetGeoInfo(
__in GEOID Location,
__in GEOTYPE GeoType,
__out LPTSTR lpGeoData,
__in int cchData,
__in LANGID LangId
);
GetGeoInfo功能
检索有关指定的地理位置。
参数
地点[in]
标识符的地理位置为其获取信息。有关更多信息,请参阅地理位置表。
GeoType [in]
信息类型检索。可能的值定义的SYSGEOTYPE枚举。如果GeoType价值GEO_LCID,检索的功能区域设置标识符。如果GeoType价值GEO_RFC1766,函数检索一个字符串名称,与RFC 4646(Windows Vista)的标准。有关详细信息,请参见备注部分。
Windows XP的:当GeoType设置为GEO_LCID,检索到的字符串是一个8位十六进制值。
Windows Me中:当GeoType设置为GEO_LCID,检索到的字符串是一个十进制值。
lpGeoData [out]
可选。缓冲区指针在本函数检索信息。
cchData [in]
缓冲区的大小指出的lpGeoData。该大小是字节的函数,或字的Unicode版本号码的ANSI版本号。应用程序可以设置为0参数,如果该函数返回的缓冲区所需的大小。
语言标识 [in]
标识的语言,在位置值。应用程序可以设置为0参数,与GEO_RFC1766或GEO_LCID为GeoType指定。此设置导致函数调用GetUserDefaultLangID检索语言标识符。
注意:应用程序必须设置此参数为0,如果有任何价值GeoType比GEO_RFC1766或GEO_LCID其他。
返回值
返回的字节数(ANSI)的或字(Unicode的)的地理位置在输出缓冲区中检索信息。如果cchData设置为0,则函数返回所需的缓冲区大小。
该函数返回0,如果没有成功。为了获得更多错误信息,应用程序可以调用GetLastError函数,可以返回以下错误代码之一:
ERROR_INSUFFICIENT_BUFFER。阿提供的缓冲区大小不够大,或者被错误地设置为NULL。
ERROR_INVALID_PARAMETER。该参数值的任何无效。
备注
如果应用程序指定为GeoType GEO_RFC1766,应指定一个语言标识语言识别适合于指定的地理位置标识符。适当的语言可以是一个区域,一个区域对应指定的标识符或一个中性的语言。结果字符串,与RFC 4646(Windows Vista)的标准,构成了区域的名称。
例如,如果地点是为美国0xF4指定GeoType被指定为GEO_RFC1766,并LangID是作为区域或0x09的中性英语或英语(美国)0x409指定,函数检索“恩美”的成功回报。事实上,该函数忽略的语言环境,语言的特定部分。因此,如果应用程序指定为英语(英国)0x809的LangID,该函数还写道:“恩美”的lpGeoData。
考虑另一个例子。如果位置是为美国0xF4指定GeoType被指定为GEO_RFC1766,并LangID是为中国0x04指定的函数检索“zh美”的成功返回。这不是受支持的语言环境的名称。
如果应用程序指定为GeoType GEO_LCID,功能视为一个区域设置标识符(LCID)语言标识符。它试图返回的区域设置标识符,如果它与某种方式提供了相关的地理标识。
要求:
最低支持client-Windows XP
最低支持serverWindows服务器2003
HeaderWinnls.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetGeoInfoW(Unicode)和GetGeoInfoA(ANSI)的
参见
国家语言支持
国家语言支持功能
SYSGEOTYPE
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月12号
==英文原文==GetGeoInfo Function
Retrieves information about a specified geographical location.
Syntax
int GetGeoInfo(
__in GEOID Location,
__in GEOTYPE GeoType,
__out LPTSTR lpGeoData,
__in int cchData,
__in LANGID LangId
);
Parameters
Location [in]
Identifier for the geographical location for which to get information. For more information, see Table of Geographical Locations .
GeoType [in]
Type of information to retrieve. Possible values are defined by the SYSGEOTYPE enumeration. If the value of GeoType is GEO_LCID, the function retrieves a locale identifier. If the value of GeoType is GEO_RFC1766, the function retrieves a string name that is compliant with RFC 4646 (Windows Vista). For more information, see the Remarks section.
Windows XP: When GeoType is set to GEO_LCID, the retrieved string is an 8-digit hexadecimal value.
Windows Me: When GeoType is set to GEO_LCID, the retrieved string is a decimal value.
lpGeoData [out]
Optional. Pointer to the buffer in which this function retrieves the information.
cchData [in]
Size of the buffer indicated by lpGeoData. The size is the number of bytes for the ANSI version of the function, or the number of words for the Unicode version. The application can set this parameter to 0 if the function is to return the required size of the buffer.
LangId [in]
Identifier for the language, used with the value of Location. The application can set this parameter to 0, with GEO_RFC1766 or GEO_LCID specified for GeoType. This setting causes the function to retrieve the language identifier by calling GetUserDefaultLangID .
Note The application must set this parameter to 0 if GeoType has any value other than GEO_RFC1766 or GEO_LCID.
Return Value
Returns the number of bytes (ANSI) or words (Unicode) of geographical location information retrieved in the output buffer. If cchData is set to 0, the function returns the required size for the buffer.
The 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_PARAMETER. Any of the parameter values was invalid.
Remarks
If the application specifies GEO_RFC1766 for GeoType, it should specify a language identifier for LangId that is appropriate to the specified geographical location identifier. The appropriate language is either a locale-neutral language or one with a locale corresponding to the specified identifier. The resulting string, compliant with RFC 4646 (Windows Vista), constitutes a locale name .
For example, if Location is specified as 0xF4 for United States, GeoType is specified as GEO_RFC1766, and LangId is specified as either 0x09 for locale-neutral English or 0x409 for English (United States), the function retrieves "en-US" on successful return. In fact, the function ignores the locale-specific portion of the language. Thus, if the application specifies LangId as 0x809 for English (United Kingdom), the function also writes "en-US" to lpGeoData.
Consider another example. If Location is specified as 0xF4 for United States, GeoType is specified as GEO_RFC1766, and LangId is specified as 0x04 for Chinese, the function retrieves "zh-US" on successful return. This is not the name of a supported locale.
If the application specifies GEO_LCID for GeoType, the function treats the language identifier as a locale identifier (LCID). It attempts to return the locale identifier if it is associated with the provided geographical identifier in some way.
Requirements
Minimum supported clientWindows XP
Minimum supported serverWindows Server 2003
HeaderWinnls.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesGetGeoInfoW (Unicode) and GetGeoInfoA (ANSI)
See Also
National Language Support
National Language Support Functions
SYSGEOTYPE
Send comments about this topic to Microsoft
Build date: 7/12/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd318099(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:28:21