Export (0) Print
Expand All

GetStringTypeW (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function returns 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.

BOOL GetStringTypeW(
  DWORD dwInfoType, 
  LPCWSTR lpSrcStr, 
  int cchSrc, 
  LPWORD lpCharType 
);

Parameters

dwInfoType
[in] Value that 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 flags. The following table shows the values this parameter can take.
ValueDescription
CT_CTYPE1Retrieve character type information.
CT_CTYPE2Retrieve bidirectional layout information.
CT_CTYPE3Retrieve text processing information.
lpSrcStr
[in] Pointer to the string for which character types are requested. If cchSrc is –1, the string is assumed to be null terminated. This must be a Unicode string.
cchSrc
[in] Size, in 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 the terminating null character. If this value is –1, the string is assumed to be null terminated and the length is calculated automatically.
lpCharType
[out] Pointer to an array of 16-bit values. The length of this array must be large enough to receive one 16-bit value for the number of characters specified in the cchSrc parameter. When the function returns, this array contains one word corresponding to each Unicode character in the source string.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call the GetLastError function. Possible values for GetLastError include the following:

  • ERROR_INVALID_FLAGS
  • ERROR_INVALID_PARAMETER

Remarks

The GetStringTypeW function is designed for Unicode strings only.

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.
NameValueDescription
C1_UPPER0x0001Uppercase
C1_LOWER0x0002Lowercase
C1_DIGIT0x0004Decimal digits
C1_SPACE0x0008Space characters
C1_PUNCT0x0010Punctuation
C1_CNTRL0x0020Control characters
C1_BLANK0x0040Blank characters
C1_XDIGIT0x0080Hexadecimal digits
C1_ALPHA0x0100Any linguistic character: alphabetic, syllabary, or ideographic

The following character types are either constant or computable from basic types and do not need to be supported by this function.

TypeDescription
AlphanumericAlphabetic 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 bidirectional 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.
NameValueDescription
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.
NameValueDescription
C3_NONSPACING0x0001Nonspacing mark
C3_DIACRITIC0x0002Diacritic nonspacing mark
C3_VOWELMARK0x0004Vowel nonspacing mark
C3_SYMBOL0x0008Symbol
C3_KATAKANA0x0010Katakana character
C3_HIRAGANA0x0020Hiragana character
C3_HALFWIDTH0x0040Half-width character
C3_FULLWIDTH0x0080Full-width 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 (alphabetic, syllabary, and ideographic)
Not applicable  
C3_NOTAPPLICABLE0x0000Not applicable

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Winnls.h.
Link Library: Coredll.lib.

See Also

GetLocaleInfo | GetStringTypeEx


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft