Home   Index   About
Ultimate Pack


Custom Search
GetStringTypeA

(LCID, dwInfoType, lpSrcStr, cchSrc, lpCharType)
LCID LCID
DWORD dwInfoType
LPCSTR lpSrcStr
int cchSrc
LPWORD lpCharType

Parameters

LCID

Locale context for the mapping. The string is assumed to be represented in the default ANSI code page for this locale.

dwInfoType

Type of character information to retrieve. The various types are divided into different levels (see Comments for a list of the information included in each type). The options are mutually exclusive. The following types are supported:

  • CT_CTYPE1

  • CT_CTYPE2

  • CT_CTYPE3

lpSrcStr

String for which character types are requested. If cchSrc is pics/OLE00090001.gif1, lpSrcStr is assumed to be null-terminated.

cchSrc

Character count of lpSrcStr. If cchSrc is pics/OLE00090001.gif1, lpSrcStr is assumed to be null-terminated. Note that this must also be the character count of lpCharType.

lpCharType

Array of the same length as lpSrcStr (cchSrc). On output, the array contains one word corresponding to each character in lpSrcStr.

Return Value

Value
Meaning
0
Failure

Success

Comments

The lpSrcStr and lpCharType pointers may not be the same; in this case the error ERROR_INVALID_PARAMETER results.

The character type bits are divided up into several levels. One level's information can be retrieved by a single call.

This function supports three character types:

  • Ctype 1

  • Ctype 2

  • Ctype 3

Ctype 1 types support ANSI C and POSIX character typing functions. A bitwise OR of these values is returned when dwInfoType is set to CT_CTYPE1. For DBCS locales, the Ctype 1 attributes apply to both the narrow characters and the wide characters. The Japanese hiragana and katakana characters, and the kanji ideograph characters all have the C1_ALPHA attribute.

The following table lists the Ctype 1 character types.

Name
Value
Meaning
C1_UPPER
  1. x0001
Uppercase1
C1_LOWER
  1. x0002
Lowercase1
C1_DIGIT
0x0004
Decimal digits
C1_SPACE
0x0008
Space characters
C1_PUNCT
0x0010
Punctuation
C1_CNTRL
0x0020
Control characters
C1_BLANK
0x0040
Blank characters
C1_XDIGIT
0x0080
Hexadecimal digits
C1_ALPHA
0x0100
Any letter
  1. The Windows version 3.1 functions IsCharUpper and IsCharLower do not always produce correct results for characters in the range 0x80-0x9f, so they may produce different results than this function for characters in that range. (For example, the German Windows version 3.1 language driver incorrectly reports 0x9a, lowercase s hacek, as uppercase).

Ctype 2 types support the proper layout of text. For DBCS locales, Ctype 2 applies to both narrow and wide characters. The directional attributes are assigned so that the BiDi layout algorithm standardized by Unicode produces the correct results. See The Unicode Standard: Worldwide Character Encoding from Addison-Wesley for more information on the use of these attributes.


Name
Value
Meaning
Strong
C2_LEFTTORIGHT
  1. x1
Left to right

C2_RIGHTTOLEFT
  1. x2
Right to left
Weak
C2_EUROPENUMBER
  1. x3
European number, European digit

C2_EUROPESEPARATOR
  1. x4
European numeric separator

C2_EUROPETERMINATOR
  1. x5
European numeric terminator

C2_ARABICNUMBER
  1. x6
Arabic number

C2_COMMONSEPARATOR
  1. x7
Common numeric separator
Neutral
C2_BLOCKSEPARATOR
  1. x8
Block separator

C2_SEGMENTSEPARATOR
  1. x9
Segment separator

C2_WHITESPACE
  1. xA
White space

C2_OTHERNEUTRAL
  1. xB
Other neutrals
Not applicable
C2_NOTAPPLICABLE
0x0
No implicit direction (for example, control codes)

Ctype 3 types are general text-processing information. A bitwise OR of these values is returned when dwInfoType is set to CT_CTYPE3. For DBCS locales, the Ctype 3 attributes apply to both the narrow characters and the wide characters. The Japanese hiragana and katakana characters and the kanji ideograph characters all have the C3_ALPHA attribute.

Name
Value
Meaning
C3_NONSPACING
  1. x1
Nonspacing mark
C3_DIACRITIC
  1. x2
Diacritic nonspacing mark
C3_VOWELMARK
0x4
Vowel nonspacing mark
C3_SYMBOL
0x8
Symbol
C3_KATAKANA
0x10
Katakana character
C3_HIRAGANA
0x20
Hiragana character
C3_HALFWIDTH
0x40
Narrow character
C3_FULLWIDTH
0x80
Wide character
C3_IDEOGRAPH
0x100
Ideograph
C3_ALPHA
0x8000
Any letter
C3_NOTAPPLICABLE
0x0
Not applicable


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2012 Free Tech Secrets ;) greatis just4fun network just4fun