网站首页  词典首页

请输入您要查询的函数:

 

术语 getstringtypew
释义 GetStringTypeW
语法:
BOOL GetStringTypeW( DWORD dwInfoType,
LPCWSTR lpSrcStr,
int cchSrc,
LPWORD lpCharType
);
GetStringTypeW功能
检索字符类型中指定的源字符串中的字符的信息。对于每个字符在字符串中,该函数设置在相应的一个或多个16位位输出数组元素。每个位确定了给定字符,例如是否字符是字母,数字或两种类型。
参数
dwInfoType
[in]指定字符类型信息的用户想收回。各类型分为不同级别划分(参见资料列表下面的备注部分包括在每个类型)。此参数可以指定下列字符类型值之一。
CT_CTYPE1
检索字符类型的信息。
CT_CTYPE2
检索双向布局信息。
CT_CTYPE3
检索文本处理的信息。
lpSrcStr
[in]指向那些性格类型的请求的字符串。如果cchSrc是一个负整数,该字符串不是假定为空终止。这必须是一个Unicode字符串。
cchSrc
[in]指定的大小,宽字符的字符串指向的lpSrcStr参数。如果此数包括终止空字符,则函数返回字符的字符类型的信息。如果该值为任何负整数,字符串被假定为空终止的长度计算是一项额外终止NULL字符宽字符自动。因此,在这种情况下,长度wcslen(lpSrcStr)+ 1。
lpCharType
[out]指向一组16位的元素。该阵列接收一个16位的在cchSrc参数中指定宽字符的数值。如果cchSrc不是负数,lpCharType应该是与cchSrc元素的Word类型的数组。如果cchSrc一个负数,lpCharType应该是与(wcslen(lpSrcStr Word类型的数组)+ 1)元素。当函数返回时,这个数组包含了一个词对应每个Unicode源字符串中的宽字符。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 GetLastError函数可以返回以下错误代码之一:
ERROR_INVALID_FLAGS
ERROR_INVALID_PARAMETER
备注
安全警告:使用GetStringTypeW功能不当,可能会损害您的应用程序的安全。为了避免缓冲区溢出,设置lpCharType缓冲区的大小正确。欲了解更多的安全信息,请参阅安全注意事项:Windows用户界面。
请注意,GetStringTypeA职能有一个多参数比GetStringTypeW功能:GetStringTypeA有第一个参数是一个名为区域设置的LCID。此参数不存在GetStringTypeW功能。由于该参数的差异,应用程序不能自动调用*通过的#define的UNICODE开关使用适当的A或W号GetStringType版本。应用程序可以通过使用GetStringTypeEx绕过这个限制,它是推荐的功能。
在lpSrcStr和lpCharType指针必须不一样。如果它们是相同的,函数失败并GetLastError返回ERROR_INVALID_PARAMETER。
字符类型位被分为几个层次。在一个级别的信息,可以检索一个调用这个函数。每个级别的限制为16比特的信息,以便其他映射例程,这些限制为16个字符表示的每比特,也可以返回字符类型的信息。
字符此功能支持的类型包括以下内容。
Ctype 1
这些类型的支持ANSI C和POSIX(LC_CTYPE按)的字符输入功能。这些数值的组合是返回数组中指出当dwInfoType参数设置为CT_CTYPE1的lpCharType参数。
NameValueMeaning
C1_UPPER 0x0001Uppercase
C1_LOWER0x0002Lowercase
C1_DIGIT0x0004Decimal数字
C1_SPACE0x0008Space字符
C1_PUNCT0x0010Punctuation
C1_CNTRL0x0020Control字符
C1_BLANK0x0040Blank字符
C1_XDIGIT0x0080Hexadecimal数字
C1_ALPHA0x0100Any语言字符:字母,音节文字,或表意
C1_DEFINED0x0200A定义的字符,而不是其他C1_ 1 *类型。
下面的字符类型不是固定或基本类型可计算,并不需要通过此功能的支持。
TypeDescription
AlphanumericAlphabetical字符和数字(C1_ALPHA和C1_DIGIT)
PrintableGraphic字符和空格(所有C1_ *类型除C1_CNTRL)
Ctype 2
这些类型的支持Unicode文本适当的布局。方向的属性分配,使双向布局算法的Unicode的标准化生产准确的结果。这些类型是互相排斥的。如需有关这些属性的使用情况,Unicode标准:全球字符编码,卷1和2,艾迪生韦斯利出版公司:1991,1992,书号0201567881。
NameValueMeaning
强壮的
C2_LEFTTORIGHT0x0001Left的权利
C2_RIGHTTOLEFT0x0002Right到左
虚弱的
C2_EUROPENUMBER0x0003European数目,欧洲数字
C2_EUROPESEPARATOR0x0004European数字分隔
C2_EUROPETERMINATOR0x0005European数字终止
C2_ARABICNUMBER0x0006Arabic号码
C2_COMMONSEPARATOR0x0007Common数字分隔
中性
C2_BLOCKSEPARATOR0x0008Block分离器
C2_SEGMENTSEPARATOR0x0009Segment分离器
C2_WHITESPACE0x000AWhite空间
C2_OTHERNEUTRAL0x000BOther中立
不适用
C2_NOTAPPLICABLE0x0000No隐方向性(例如,控制代码)
Ctype 3
这些类型的目的是用于宣传的POSIX一般文字处理所需类型的扩展名占位符或标准C库函数。这些数值的组合时返回dwInfoType设置为CT_CTYPE3
NameValueMeaning
C3_NONSPACING0x0001Nonspacing标志。
C3_DIACRITIC0x0002Diacritic nonspacing标志。
C3_VOWELMARK0x0004Vowel nonspacing标志。
C3_SYMBOL0x0008Symbol。
C3_KATAKANA0x0010Katakana字符。
C3_HIRAGANA0x0020Hiragana字符。
C3_HALFWIDTH0x0040Half宽(窄)字符。
C3_FULLWIDTH0x0080Full宽(宽)字符。
C3_IDEOGRAPH0x0100Ideographic字符。
C3_KASHIDA0x0200Arabic卡须达字符。
C3_LEXICAL0x0400Punctuation这算不算是单词的一部分(卡须达,连字符,女性/男性序指标,等号,等等)。
C3_ALPHA0x8000All语言字符(字母,音节文字和表意)。
C3_HIGHSURROGATE0x0800Windows Vista和更高版本:高代理编码单元。
C3_LOWSURROGATE0x1000Windows Vista和更高版本:低代理编码单元。
不适用
C3_NOTAPPLICABLE0x0000Not适用。
在Windows 95/98/Me:GetStringTypeW是支持的Unicode(MSLU)微软层。因为它不具有区域设置参数,在GetStringTypeA便是MSLU使用LOCALE_SYSTEM_DEFAULT。要使用此函数的版本,您必须添加一些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
功能信息
最低DLL版本 kernel32.dll
在Winnls.h HeaderDeclared,头文件:winuser.h
import libraryKernel32.lib
最低经营systemsWindows新台币3.1
UnicodeImplemented为Unicode版本。
参见
Strings 概述 ,GetLocaleInfo,GetStringTypeA,GetStringTypeEx
==英文原文==GetStringTypeW Function
Retrieves character-type information for the characters in the specified source string. For each character in the string, the function sets one or more bits in the corresponding 16-bit element of the output array. Each bit identifies a given character type, such as whether the character is a letter, a digit, or neither.
Syntax
BOOL GetStringTypeW( DWORD dwInfoType,
LPCWSTR lpSrcStr,
int cchSrc,
LPWORD lpCharType
);
Parameters
dwInfoType
[in] Specifies the type of character information the user wants to retrieve. The various types are divided into different levels (see the following Remarks section for a list of the information included in each type). This parameter can specify one of the following character type values.
CT_CTYPE1
Retrieve character type information.
CT_CTYPE2
Retrieve bi-directional layout information.
CT_CTYPE3
Retrieve text processing information.
lpSrcStr
[in] Pointer to the string for which character types are requested. If cchSrc is a negative integer, the string is not assumed to be null-terminated. This must be a Unicode string.
cchSrc
[in] Specifies the size, in wide characters, of the string pointed to by the lpSrcStr parameter. If this count includes a terminating null character, the function returns character type information for that character. If this value is any negative integer, the string is assumed to be null-terminated and the length is calculated automatically with an additional wide character for a terminating NULL character. Thus, in this case, the length is wcslen(lpSrcStr) + 1.
lpCharType
[out] Pointer to an array of 16-bit elements. The array receives one 16-bit value for the number of wide characters specified in the cchSrc parameter. If cchSrc is not a negative number, lpCharType should be an array of type WORD with cchSrc elements. If cchSrc is a negative number, lpCharType should be an array of type WORD with (wcslen(lpSrcStr) + 1) elements. When the function returns, this array contains one word corresponding to each Unicode wide character in the source string.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError . GetLastError can return one of the following error codes:
ERROR_INVALID_FLAGS
ERROR_INVALID_PARAMETER
Remarks
Security Alert Using the GetStringTypeW function incorrectly can compromise the security of your application. To avoid a buffer overflow, set the size of the lpCharType buffer correctly. For more security information, see Security Considerations: Windows User Interface .
Note that the GetStringTypeA function has one more parameter than the GetStringTypeW function: GetStringTypeA has a first parameter that is an LCID named Locale. This parameter does not exist in the GetStringTypeW function. Because of that parameter difference, an application cannot automatically invoke the proper A or W version of GetStringType* through the use of the #define UNICODE switch. An application can circumvent this limitation by using GetStringTypeEx ; it is the recommended function.
The lpSrcStr and lpCharType pointers must not be the same. If they are the same, the function fails and GetLastError returns ERROR_INVALID_PARAMETER .
The character-type bits are divided into several levels. The information for one level can be retrieved by a single call to this function. Each level is limited to 16 bits of information so that the other mapping routines, which are limited to 16 bits of representation per character, can also return character-type information.
The character types supported by this function include the following.
Ctype 1
These types support ANSI C and POSIX (LC_CTYPE) character-typing functions. A combination of these values is returned in the array pointed to by the lpCharType parameter when the dwInfoType parameter is set to CT_CTYPE1.
NameValueMeaning
C1_UPPER 0x0001Uppercase
C1_LOWER0x0002Lowercase
C1_DIGIT0x0004Decimal digits
C1_SPACE0x0008Space characters
C1_PUNCT0x0010Punctuation
C1_CNTRL0x0020Control characters
C1_BLANK0x0040Blank characters
C1_XDIGIT0x0080Hexadecimal digits
C1_ALPHA0x0100Any linguistic character: alphabetical, syllabary, or ideographic
C1_DEFINED0x0200A defined character, but not one of the other C1_* types.
The following character types are either constant or computable from basic types and do not need to be supported by this function.
TypeDescription
AlphanumericAlphabetical characters and digits (C1_ALPHA and C1_DIGIT)
PrintableGraphic characters and blanks (all C1_* types except C1_CNTRL)
Ctype 2
These types support proper layout of Unicode text. The direction attributes are assigned so that the bi-directional layout algorithm standardized by Unicode produces accurate results. These types are mutually exclusive. For more information about the use of these attributes, see The Unicode Standard: Worldwide Character Encoding, Volumes 1 and 2, Addison Wesley Publishing Company: 1991, 1992, ISBN 0201567881.
NameValueMeaning
Strong
C2_LEFTTORIGHT0x0001Left to right
C2_RIGHTTOLEFT0x0002Right to left
Weak
C2_EUROPENUMBER0x0003European number, European digit
C2_EUROPESEPARATOR0x0004European numeric separator
C2_EUROPETERMINATOR0x0005European numeric terminator
C2_ARABICNUMBER0x0006Arabic number
C2_COMMONSEPARATOR0x0007Common numeric separator
Neutral
C2_BLOCKSEPARATOR0x0008Block separator
C2_SEGMENTSEPARATOR0x0009Segment separator
C2_WHITESPACE0x000AWhite space
C2_OTHERNEUTRAL0x000BOther neutrals
Not applicable
C2_NOTAPPLICABLE0x0000No implicit directionality (for example, control codes)
Ctype 3
These types are intended to be placeholders for extensions to the POSIX types required for general text processing or for the standard C library functions. A combination of these values is returned when dwInfoType is set to CT_CTYPE3
NameValueMeaning
C3_NONSPACING0x0001Nonspacing mark.
C3_DIACRITIC0x0002Diacritic nonspacing mark.
C3_VOWELMARK0x0004Vowel nonspacing mark.
C3_SYMBOL0x0008Symbol.
C3_KATAKANA0x0010Katakana character.
C3_HIRAGANA0x0020Hiragana character.
C3_HALFWIDTH0x0040Half-width (narrow) character.
C3_FULLWIDTH0x0080Full-width (wide) character.
C3_IDEOGRAPH0x0100Ideographic character.
C3_KASHIDA0x0200Arabic Kashida character.
C3_LEXICAL0x0400Punctuation which is counted as part of the word (Kashida, hyphen, feminine/masculine ordinal indicators, equal sign, and so forth).
C3_ALPHA0x8000All linguistic characters (alphabetical, syllabary, and ideographic).
C3_HIGHSURROGATE0x0800Windows Vista and later: High surrogate code unit.
C3_LOWSURROGATE0x1000Windows Vista and later: Low surrogate code unit.
Not applicable
C3_NOTAPPLICABLE0x0000Not applicable.
Windows 95/98/Me: GetStringTypeW is supported by the Microsoft Layer for Unicode (MSLU). Because it does not have the Locale parameter that is in GetStringTypeA, the MSLU uses LOCALE_SYSTEM_DEFAULT . To use this version of the function, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Function Information
Minimum DLL Versionkernel32.dll
HeaderDeclared in Winnls.h, include Windows.h
Import libraryKernel32.lib
Minimum operating systemsWindows NT 3.1
UnicodeImplemented as Unicode version.
See Also
Strings Overview , GetLocaleInfo , GetStringTypeA , GetStringTypeEx
==原始网址==http://msdn.microsoft.com/en-us/library/ms647481(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:17:15