设为首页收藏本站官方微博

【汉化资料】字体、语言相关的API函数原型

[复制链接]
查看: 1862|回复: 1
打印 上一主题 下一主题

【汉化资料】字体、语言相关的API函数原型

跳转到指定楼层
楼主
发表于 2009-1-16 21:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

【汉化资料】字体、语言相关的API函数原型

字体、语言相关的API函数原型:
2 E( q2 R; W$ G( C3 D# D$ f# Y* i( O/ m. W
createFont 用指定的属性创建一种逻辑字体 ; M9 i; z/ n, y* i+ c: Z& |
createFontIndirect 用指定的属性创建一种逻辑字体
5 ~1 M1 D1 x+ kGetStockObject 取得一个固有对象(笔、刷子、字体等)1 {4 G+ w2 Z% Q" ?! g. m7 H) o0 y" Q

' J. L! J* p( a& L0 C/ @/ }GetACP 检取ANSI系统代码页的标识符; e) e. h3 j# t" [
GetOEMCP 检取系统的OEM代码页标识符- D0 S+ m2 F9 c" n) ]* ?' y
GetTextExtentPoint 判断一个字串的大小(范围)(用于限制输入), g( ?, H" C2 ?, ^4 x
EnumFontFamilies 列举指定设备可用的字体6 _/ |$ t; h7 l: \7 M
EnumFontFamiliesEx 列举指定设备可用的字体 ' u0 k" D/ O4 B( }
EnumFonts 列举指定设备可用的字体
* U& ^. O9 F: t# H5 A* K% ]GetSystemDefaultLangID 取得系统的默认语言ID 4 Y0 `  i9 [1 j. ~# z! ]5 h$ {
GetUserDefaultLangID 为当前用户取得默认语言ID
& O- Q. {4 o0 R1 cGetStringTypeA 获取ANSI字符串类型 ,返回指定字符串的字符类型信息
) f: G, q) G! l6 _6 V* DGetStringTypeW 返回一个Unicode串的字符类型信息
8 O- H- f) S0 T: v; H& zGetSystemDefaultLangID 检取系统缺省语言标识符
; u% k7 ]$ O: F5 c' sWideCharToMultiByte 把一个宽字符串映射为一个新字符串- a! x4 i/ c. W  Q* k% S. W: E

& K$ e$ Q# k( V  y" x: g=====================================================================4 O7 E9 V2 O9 [* m6 z7 ]
3 D" f# e( h: W
HFONT CreateFont(
1 @( ^% o5 ?6 ^) I( G2 g1 p( u% ?6 G: @
int nHeight, // logical height of font 4 j# w. k& S# @8 v8 Y- V% \& L
int nWidth, // logical average character width 4 y% h. F. V0 V  h. \. D  d
int nEscapement, // angle of escapement $ A: l# Q/ x& ]& q% ?# L5 I- v0 H
int nOrientation, // base-line orientation angle : L8 a0 a4 a" l; ]$ s
int fnWeight, // font weight
7 r+ j$ z$ |7 k% C# D4 hDWORD fdwItalic, // italic attribute flag
) T/ }6 a5 U" j1 a( sDWORD fdwUnderline, // underline attribute flag * k: M  T2 V$ `9 T3 o& c, _0 I3 o
DWORD fdwStrikeOut, // strikeout attribute flag
& H0 @; L* j+ s3 I& GDWORD fdwCharSet, // character set identifier
8 d4 s; W% T" EDWORD fdwOutputPrecision, // output precision
7 N8 W! n/ z' l* cDWORD fdwClipPrecision, // clipping precision
$ h0 ~+ _8 z9 \. jDWORD fdwQuality, // output quality 4 Q* s! ^4 R& f- H/ }
DWORD fdwPitchAndFamily, // pitch and family " @% s- ^7 l  I0 J3 _+ P% a
LPCTSTR lpszFace // pointer to typeface name string
, K9 `+ V1 S9 i);
+ P& i0 w- `. v( _" F% t7 @" D  M( B( T- s
==========================================================================
3 S. w$ i, T/ ^, V, s5 i! B" OHFONT CreateFontIndirect(6 K* Y) g7 E+ w; f% {& c4 E

  r! k9 S2 g1 |. a4 JCONST LOGFONT *lplf // pointer to logical font structure
& }+ e0 U. {" d* K& X0 o);
, `6 v. n$ b- J9 u2 j- A6 D
+ G8 @4 h/ N0 S5 O1 ~==========================================================================
8 W. y# B& l  r) v7 ^HGDIOBJ GetStockObject(
4 S0 {' X6 }" H1 z
# H4 z4 k6 k, r- N+ Rint fnObject // type of stock object * s; ]# t6 n6 ~. J- _* x' q& b8 y
);7 r- I" U3 E8 V6 C$ U0 }/ |' d

/ u. r' j1 y5 ~  [. V8 J* |/ T7 Q: Z, z; O+ `& r, h
fnObject) i, n' [& P( J
Specifies the type of stock object. This parameter can be any one of the following values:
: f8 N# ~" l. B# OValue
+ Z* _: {. L( S4 F# D4.BLACK_BRUSH Black brush.+ l; U: d- o) O5 o3 m# K" g& x6 u
3.DKGRAY_BRUSH Dark gray brush.
8 g( c1 M) @4 H  A/ |0 P6 z& E2.GRAY_BRUSH Gray brush.0 U' o3 r' N8 M! _' A" g1 W
5.HOLLOW_BRUSH Hollow brush (equivalent to NULL_BRUSH).4 A- Q  O0 m3 R# w7 Q
1.LTGRAY_BRUSH Light gray brush.
# Y) B- L7 I4 l5.NULL_BRUSH Null brush (equivalent to HOLLOW_BRUSH).
' g" \! k% a' n* u( ]: I% j9 G% A0.WHITE_BRUSH White brush.' G( j) s4 J0 _# s$ x4 f6 H% m
7.BLACK_PEN Black pen.
, p+ I/ B( H, \# s8.NULL_PEN Null pen.6 h0 [9 w6 T5 E$ g! ]
6.WHITE_PEN White pen.: \  m2 E, L3 D% h# R+ t7 g( A
11.(0B)ANSI_FIXED_FONT Windows fixed-pitch (monospace) system font.$ ~3 `/ R" Q. L% _2 A
12.(0C)ANSI_VAR_FONT Windows variable-pitch (proportional space) system font.$ o) |1 s' Z' o/ m- k  E: h
14.(0E)DEVICE_DEFAULT_FONT Windows NT only: Device-dependent font.
( Y6 d' j2 n& w  n17.(11)DEFAULT_GUI_FONT Windows 95 only: Default font for user interface objects such as menus and dialog boxes.(一般选这种), {; l6 X+ L) ~9 g4 e% [# T
10.(0A)OEM_FIXED_FONT Original equipment manufacturer (OEM) dependent fixed-pitch (monospace) font.# v( }0 |5 q/ P* U& {  Q
13.(0D)SYSTEM_FONT System font. By default, Windows uses the system font to draw menus, dialog box controls, and text. In Windows versions 3.0 and later, the system font is a proportionally spaced font; earlier versions of Windows used a monospace system font.
6 o+ e6 o0 c- E16.(10)SYSTEM_FIXED_FONT Fixed-pitch (monospace) system font used in Windows versions earlier than 3.0. This stock object is provided for compatibility with earlier versions of Windows.6 y% r+ q! u5 E% `: w
15.DEFAULT_PALETTE Default palette. This palette consists of the static colors in the system palette.( g9 C$ }4 H9 T5 i- L# E8 c
If the function succeeds, the return value identifies the logical object requested.: g5 Z% v! g, \1 l  L
If the function fails, the return value is NULL. ; W# b0 {1 d9 ~, K1 [
=================================================================================
( y* E  g" Y1 w& ^& p" ^The GetACP function retrieves the current ANSI code-page identifier for the system.9 A. b0 Y; J" O# I) p
UINT GetACP(VOID)- Q- t5 g) [8 e& P2 x

' p& J$ V5 t4 w( T2 {Parameters* ]1 e5 Y3 z. @2 z9 }% ?
This function has no parameters. : I" ^$ r, \- L9 ~
Return Values
# ~% l4 {! v# }5 {% d3 R; xIf the function succeeds, the return value is the current ANSI code-page identifier for the system, or a default identifier if no code page is current.
) j  b, \. g+ c7 ?* A& ~Remarks) t6 |, ?& J  E6 Y4 B
Following are the ANSI code-page identifiers: ! P- n' V! {# W
Identifier Meaning
6 k8 C! J3 G" Z( x+ `874 Thai8 r+ E. f5 }6 e4 B, S1 c; l
932 Japan$ d! Q; Y3 [1 H9 X+ f8 [5 k2 O
936 Chinese (PRC, Singapore)- P( z% L  V! L6 a0 t
949 Korean
( S- B! G2 r* ~- K3 e950 Chinese (Taiwan, Hong Kong) 0 X# I5 ~! P$ P
1200 Unicode (BMP of ISO 10646)( ^# O9 D0 Y. Q: e2 ~& e
1250 Windows 3.1 Eastern European
* h/ w' d- w* l1251 Windows 3.1 Cyrillic
/ v( U1 V$ c$ M- S1252 Windows 3.1 Latin 1 (US, Western Europe)  }  l1 o) J7 K/ \0 c
1253 Windows 3.1 Greek# e" ^9 ]9 W5 x& ~. L0 a  V
1254 Windows 3.1 Turkish
; |; w# Q" A( c- V* {, {: O9 R1255 Hebrew: n/ a7 @: n3 b9 c$ ~  {
1256 Arabic' t: D: {. {1 H$ m
1257 Baltic
5 T  i3 B/ k6 m( g( i5 x8 b6 ]# k! F=============================================================================% H9 x3 J# V: j" i. i
The GetOEMCP function retrieves the current OEM code-page identifier for the system. (OEM stands for original equipment manufacturer.) # L- O: W' g% x$ j: i- f3 l) v) {. I

& K  ~& H6 ~! {& j1 VUINT GetOEMCP(VOID)
$ }. F: n+ K& S/ }' a& y9 Q8 {5 s& F' q9 }/ z5 \

" i  E+ c6 T& q, ~; j: N9 v- ^Parameters
; E& J8 y: ^- s* x  H
% Q% T6 P7 M" u- a! I" V8 BThis function has no parameters.
% L1 y& u5 l2 w2 u! |4 O. f/ I; `7 ]' m6 g  v7 ~/ f
Return Values
8 Q5 j7 M% q' Q8 _, D1 i# T& u4 u, y: N% S9 X* u# K
If the function succeeds, the return value is the current OEM code-page identifier for the system or a default identifier if no code page is current.
) a! [7 I# w: P7 a0 w
' N4 W% k. |' B/ D% y! z- mRemarks( p: Z$ j  n: y1 B6 a( I
* z+ o8 @" O8 |) I' {; u
Following are the OEM code-page identifiers: % G) T8 C1 X6 k1 e  w

" l$ i7 ^( M% X$ V7 l" E# GIdentifier Meaning
7 ?% W$ _/ Y: T8 f" }5 N437 MS-DOS United States, `& y$ s, B/ M9 M. ^" i
708 Arabic (ASMO 708)
( `5 M" u7 d. C$ o6 }6 E' B. m8 E3 w709 Arabic (ASMO 449+, BCON V4)
; q; M! K( L' h+ K; A4 q9 R$ ~' r710 Arabic (Transparent Arabic)
+ y9 w9 c; b. @720 Arabic (Transparent ASMO)5 z2 h! `& U$ e! P2 x$ j
737 Greek (formerly 437G)
* \! Z* ?5 z$ G' a# I/ i/ v775 Baltic
3 J! D+ F( d9 k) R1 t2 H; O2 @8 {850 MS-DOS Multilingual (Latin I)
( W- u% A) L: f$ p9 q: _852 MS-DOS Slavic (Latin II)
- Z5 E) ?2 {3 |6 x855 IBM Cyrillic (primarily Russian)
$ O+ t# K* m, I1 \/ ]857 IBM Turkish& B3 p8 i3 {: E! _
860 MS-DOS Portuguese3 x2 q; e% X9 F) C
861 MS-DOS Icelandic
7 v" A% I# y" f862 Hebrew* B& f5 V' `: ]. m
863 MS-DOS Canadian-French  f% D% p  `5 i" O
864 Arabic
. p, ^# Q1 h+ Y8 S865 MS-DOS Nordic
; B/ Q' O6 l3 P1 n  x866 MS-DOS Russian (former USSR)* p0 d2 D# y0 _/ h5 v
869 IBM Modern Greek7 p2 T( I% o1 T! j
874 Thai
) [6 s) i" i7 P' d& {6 K7 z2 j932 Japan
7 f& s1 k! A; }7 R! C6 w7 `' a' i936 Chinese (PRC, Singapore). Z" ^* v  e$ X3 C5 F
949 Korean
  ]$ m8 _' R  v: ^) s950 Chinese (Taiwan, Hong Kong)
! I2 ^7 z/ ~: i3 E4 M( s& x1361 Korean (Johab)5 n' B- G) z8 d& h
===============================================================================9 Q" f+ x' ?, ?. a* P
BOOL GetTextExtentPoint(
3 ~, ]* o& Y& F* x! h" ^0 z, U: Z: C
HDC hdc, // handle of device context * a; q  `/ g" T3 }! n
LPCTSTR lpString, // address of text string
. s8 l, h) Z8 P1 i8 Oint cbString, // number of characters in string " o2 L9 P: O4 _# j, s
LPSIZE lpSize // address of structure for string size
) I7 j8 }0 j8 A/ S( ]# n: W- ~);
! l& |  P6 k- s! k7 c% Z, e===============================================================================3 V( j" [; y: J. `& Z
The EnumFontFamilies function enumerates the fonts in a specified font family that are available on a specified device. This function supersedes the EnumFonts function. ' X1 `9 b& n8 C' \/ h& b
int EnumFontFamilies(2 K0 ~5 N" m/ x7 ?
HDC hdc, // handle to device control
% {0 I7 h$ s- B; v* T, X/ uLPCTSTR lpszFamily, // pointer to family-name string ; W1 k( l8 [9 ~; h
FONTENUMPROC lpEnumFontFamProc, // pointer to callback function ; J; M8 @6 K  S9 F  q
LPARAM lParam // address of application-supplied data
4 a( t0 f9 \: Y2 w6 q- n; n# `, q; n);
6 U) w3 b# W8 U/ ]# A% [
: a8 s: h- N' t  }; b* aParameters
3 K4 v* k9 H& I! w2 K, w: g+ Whdc
8 \" q  k0 K  @6 b' J+ z7 R5 B( GIdentifies the device context.
8 W6 w4 Z1 w, w% w, |lpszFamily7 r3 i7 a& D1 |
Points to a null-terminated string that specifies the family name of the desired fonts. If lpszFamily is NULL, EnumFontFamilies randomly selects and enumerates one font of each available type family. 7 d: c$ R. \% S" _4 E4 Y  }3 r
lpEnumFontFamProc% e3 n1 D' E4 M9 h" L; A
Specifies the procedure-instance address of the application-defined callback function. For information about the callback function, see the EnumFontFamProc function. & n3 ~1 K, W" D' s5 T. x
lParam
+ n* k. n( Q$ g' X- p! DPoints to application-supplied data. The data is passed to the callback function along with the font information. 0 i5 B0 R/ h) _8 _, u( y, H8 K5 e( x

# K/ K) n3 H, t8 ?6 Y, kReturn Values
0 [" G0 V' Z( u' BIf the function succeeds, the return value is the last value returned by the callback function. Its meaning is implementation specific.
. \$ d. B& B: o! M# m) `; O=============================================================================
" Z: b2 c$ O# O6 t3 fThe EnumFontFamiliesEx function enumerates all fonts in the system that match the font characteristics specified by the - J* D+ w# r6 S& `" ^7 ]# m6 n
LOGFONT structure. EnumFontFamiliesEx enumerates fonts based on typeface name, character set, or both. It is recommended that Win32-based applications use this function rather than EnumFontFamilies to enumerate fonts.
. ^6 L- P$ @# w+ ~$ M9 e9 v9 L% J  ]+ O' t* E
int EnumFontFamiliesEx(
( h) e# X% F0 @' p8 O$ L. }4 PHDC hdc, // handle to device context$ b$ v6 p8 d1 X9 C  ~9 B
LPLOGFONT lpLogfont, // pointer to logical font information
+ B6 x3 |: d( cFONTENUMPROC lpEnumFontFamExProc, // pointer to callback function3 I5 c0 U/ G8 @4 o
LPARAM lParam, // application-supplied data
# L  L- X1 U+ U2 e! G+ RDWORD dwFlags // reserved; must be zero& x0 k. c1 _  E3 ]) M% ^7 c
);
9 B0 ^- W: F% t0 W4 q  ~8 K=================================================================================
. G7 V0 l2 `! m2 R: i4 IThe EnumFonts function enumerates the fonts available on a specified device. For each font with the specified typeface name, the EnumFonts function retrieves information about that font and passes it to the application-defined callback function. This callback function can process the font information as desired. Enumeration continues until there are no more fonts or the callback function returns zero. : W; W% z- }; I0 e( b  W' V
This function is provided for compatibility with earlier versions of Microsoft Windows. Win32-based applications should use the EnumFontFamilies function.
$ `: D- h# b6 b  r3 g. ]0 }  P5 q+ A5 `- T% x8 D
int EnumFonts(* h- r  W, P6 F; `' o! A
HDC hdc, // handle to device context
% P/ R# G  a% ~LPCTSTR lpFaceName, // pointer to font typeface name string 2 C9 ?1 p# L  l+ s. w" x
FONTENUMPROC lpFontFunc, // pointer to callback function
7 N+ Q. b" h* r: B: ?2 v4 I- iLPARAM lParam // address of application-supplied data
5 A8 }, C2 |: f- P, Q0 }8 d);
0 y& }% y# m! M& o6 t! Z2 h( P5 w( b# I8 q! Z- J  t) H& [8 B& K: e
Parameters2 r: n: _' J+ v0 J# D" i* }3 V! o+ b
hdc
4 L5 w' \! F$ ~+ hIdentifies the device context.
) e, L# `$ ~" XlpFaceName" p# z& o1 k  }
Points to a null-terminated character string that specifies the typeface name of the desired fonts. If lpFaceName is NULL, EnumFonts randomly selects and enumerates one font of each available typeface. 8 F, b& L7 w. B1 y
lpFontFunc
+ |  m0 ?% y- n6 |( BPoints to the application-defined callback function. For more information about the callback function, see the EnumFontsProc function. : p2 D8 U" s, @5 \) W
lParam
8 J: J& W! B3 y* X" n: u+ k# zPoints to any application-defined data. The data is passed to the callback function along with the font information. $ A* ]6 e+ j+ o0 d$ `4 ~

, O' w+ Q5 I3 u/ K* t) `! m. N2 G! R% i. F8 \+ [, _/ `
Return Values; g' c1 V) _" `8 X1 l" `$ Y
If the function succeeds, the return value is the last value returned by the callback function. Its meaning is defined by the application. # L. e, e6 S& n6 D# p! ~- t
======================================================================
$ F3 t8 C( D; C: n& bThe GetSystemDefaultLangID function retrieves the system default language identifier. + \2 A" y6 W+ I0 s0 y. Z  x$ ?# }( g

0 R9 o0 L9 H/ h: L( I2 R/ P% e5 _LANGID GetSystemDefaultLangID(VOID)/ b6 C) G0 e- n8 |- R3 r' m: r2 X
# H0 F2 B1 h- R- ]8 n" O8 S8 B
Parameters
+ t: h! s+ e! L2 @" ?. B* jThis function has no parameters.
2 {8 l; C) C+ k) p. uReturn Values
* {' `- `, i; UIf the function succeeds, the return value is the system default language identifier.
. _4 I+ y, S3 e( r8 w================================================================================2 z  X+ L$ k4 o' P" B7 |
The GetUserDefaultLangID function retrieves the user default language identifier. ( a4 j5 L  _. c
5 h& }- R/ Y) A( D+ J4 e
LANGID GetUserDefaultLangID(VOID)5 z- Z& x/ O% s1 U3 U; Y8 M* y
! N+ V1 t: ]4 b/ ]1 u6 d3 o
Parameters( o: E  l: J, e6 S) B4 B$ }
This function has no parameters.
0 l) ^. r; ]" R. zReturn Values
1 Q4 \0 `! ]7 m& _If the function succeeds, the return value is the user default language identifier.5 {. T& W6 O8 Q! f3 A
================================================================================
/ S# o; D6 B! O4 e2 i; D
8 ^" c9 ^. Y9 \4 X2 ZBOOL GetStringTypeA(
* t5 v$ V3 Y% E; r  b2 \  l( H3 j; L( i2 o
LCID Locale, // locale identifer5 ~' o9 e% t( k! t. u* U
DWORD dwInfoType, // information-type options $ ~% j7 @; \& ~
LPCSTR lpSrcStr, // pointer to the source string 3 u: d1 W/ |9 [6 p) \$ k
int cchSrc, // size, in bytes, of the source string 7 g4 t  s7 X9 N, k3 b, M
LPWORD lpCharType // pointer to the buffer for output
0 L7 L5 k3 e: ]' e) i6 m7 U);  z& o6 c# j0 s( v( m8 e  m6 p# @
Parameters
, n. R& u) h4 h3 v- ^) E, K0 C  U( YLocale* Q# o! _7 |8 T+ y
LOCALE_SYSTEM_DEFAULT Default system locale  u3 D  ]4 m; X: i! z. T" h
LOCALE_USER_DEFAULT Default user locale
3 X' V. }; p% ~& ydwInfoType  x: t* S" \3 b* [4 ?' ~" b
CT_CTYPE1 Retrieve character type information.
1 c" `" \" s6 v* l. [) kCT_CTYPE2 Retrieve bidirectional layout information.0 d! }! H0 @7 r" c
CT_CTYPE3 Retrieve text processing information.! z# s  k' B( d  f9 M' F+ k
lpSrcStr/ j% H, a. ^( j% Q3 w" X2 k9 V
Points to the string for which character types are requested. If cchSrc is -1, the string is assumed to be null terminated. This must be an ANSI string. Note that this can be a double-byte character set (DBCS) string if the locale is appropriate for DBCS.0 o+ n" r0 \- M
cchSrc
3 C6 c) i* T& \+ XSpecifies the size, in bytes, of the string pointed to by the lpSrcStr parameter. If this count includes a null terminator, the function returns character type information for the null terminator. If this value is -1, the string is assumed to be null terminated and the length is calculated automatically. / Z* M) J$ d+ f2 x. t
lpCharType, D. W- L, G" L  x0 w% b8 @
Points to an array of 16-bit values. The length of this array must be large enough to receive one 16-bit value for each character in the source string. When the function returns, this array contains one word corresponding to each character in the source string.
, c9 T, s- `  ^* F+ B( V
' k+ r0 C! O) i; C0 R' _Return Values- J( h. B2 |* Q6 `
If the function succeeds, the return value is nonzero.
+ ], N5 W1 @+ ~+ Q, T9 e8 R=================================================================
; s8 R3 a* M* r/ N0 |BOOL GetStringTypeW(( J; `( d" z* I  }( W3 l! V
5 E- f( ]# o& D8 s1 R+ R
DWORD dwInfoType, // information-type options $ d" C9 x5 s: V5 n1 Z
LPCWSTR lpSrcStr, // address of source string 5 Y& {0 ?$ q/ z' d4 }5 y
int cchSrc, // number of characters in string 6 _) g4 H4 q  [! q" c& O- D/ F0 D2 v
LPWORD lpCharType // address of buffer for output
" D  |6 M4 O# B1 K3 }' ^6 L);1 v, C% [6 e- m2 L; i# X3 V3 T$ ?
==========================================================================9 c+ h; `* y$ K8 m2 y
The GetSystemDefaultLangID function retrieves the system default language identifier.
5 e& R1 l, N& O* B9 ?: h( {LANGID GetSystemDefaultLangID(VOID)
; d4 V& \3 X7 m9 Z- @
3 Z' l1 v1 B: n6 O) o, T& ^
2 V* a" q, |; X! g) }0 ]Parameters
9 C" {3 i, y$ fThis function has no parameters. , \' K) u- V% X2 ~* Y

+ I4 \: x0 g" C1 H! W5 t* EReturn Values) m: b1 n* c9 g4 e! l& K+ |1 J) S
If the function succeeds, the return value is the system default language identifier.
# r9 @' P/ _, F: N8 A# e' @4 D0 C1 w2 }* ^/ k
Remarks
6 c( {& @1 p% uFor more information about language identifiers, see Language Identifiers and Locales.
' `: T9 M- P# O===============================================================================3 A4 n* u' \: k; s2 F
int WideCharToMultiByte(
# j) j$ s+ V' |+ f1 G/ d/ P: t
" d* ]% d  S' @( W/ I/ g4 tUINT CodePage, // code page / A& l! u/ G  q
DWORD dwFlags, // performance and mapping flags
% z, T" w! L, R; K* p6 z% d5 X0 hLPCWSTR lpWideCharStr, // address of wide-character string / g; F. A( Z# s/ c8 |4 i% M0 g
int cchWideChar, // number of characters in string
- A/ E( f( m6 k* g0 Q7 U) hLPSTR lpMultiByteStr, // address of buffer for new string % o6 q3 M2 ]" c: p% k0 `4 u
int cchMultiByte, // size of buffer 4 w5 {* d* q0 j6 j
LPCSTR lpDefaultChar, // address of default for unmappable characters
% x. |0 A1 f+ f( t3 ^LPBOOL lpUsedDefaultChar // address of flag set when default char. used
0 Z+ b" L2 d8 C3 Y1 \0 R- W* I, G! ^);
9 Z7 i; @0 N# F% c
8 ^, `, O8 P) E/ l' X( Q1 B! o" Z7 U% e
Parameters
( b$ R+ V$ m) |# P+ Y! P5 Z" U
! P4 Z. I$ H; G5 {( {, NCodePage' y, Q9 }% {' ?' k# d2 q! m3 M
Specifies the code page used to perform the conversion. This parameter can be given the value of any codepage that is installed or available in the system. The following values may be used to specify one of the system default code pages:
3 |; [8 u3 p( I/ l8 a; I( Z+ m5 ~3 L# t) d3 |, M
Value Meaning9 N4 I. H. B5 G& V
CP_ACP ANSI code page9 A8 ?, r7 q( N: ~$ P  i
CP_MACCP Macintosh code page
7 q( }; d0 j5 w4 x5 HCP_OEMCP OEM code page- E% k; u* x! {2 a" {9 m2 j; c
- M" S" `+ _4 D
dwFlags8 \! N( P7 \* l& W! ^
A set of bit flags that specify the handling of unmapped characters. The function performs more quickly when none of these flags is set. The following flag constants are defined:1 I3 y: f8 `! F2 v. b! P
. c; Z* a  G) t7 b$ j8 C* F
Value Meaning$ u, b! Y( e: \8 R4 p4 S5 [
WC_COMPOSITECHECK Convert composite characters to precomposed characters." O7 M) R" E1 ^- d0 s& b$ {: o
WC_DISCARDNS Discard nonspacing characters during conversion.* I' [, e2 g" k
WC_SEPCHARS Generate separate characters during conversion. This is the default conversion behavior.6 ^& G" V; S2 w
WC_DEFAULTCHAR Replace exceptions with the default character during conversion.7 R0 U' i; e% r6 i9 s  x; M

' O/ m, Q/ F$ V( U0 x$ Q- ~) oWhen WC_COMPOSITECHECK is specified, the function converts composite characters to precomposed characters. A composite character consists of a base character and a nonspacing character, each having different character values. A precomposed character has a single character value for a base/nonspacing character combination. In the character ? the 0 F% a% c  v* ^+ J# h
e is the base character, and the accent grave mark is the nonspacing character.
% i' g4 @; G6 H7 ^. d$ x$ N4 W2 r6 D
- n- x" V% ?0 Z* d" fWhen an application specifies WC_COMPOSITECHECK, it can use the last 3 flags in this list (WC_DISCARDNS, WC_SEPCHARS, and WC_DEFAULTCHAR) to customize the conversion to precomposed characters. These flags determine the functions behavior when there is no precomposed mapping for a base/nonspace character combination in a wide-character string. These last 3 flags can only be used if the WC_COMPOSITECHECK flag is set.
( u& w! b6 E9 Z  W* sThe functions default behavior is to generate separate characters (WC_SEPCHARS) for unmapped composite characters.' Z- N- d" p  |- d8 q- B4 U

1 J( r. d- u1 N+ {/ }lpWideCharStr
9 m1 ^, f) b. o2 C; UPoints to the wide-character string to be converted.
- k5 k) ?( [3 n0 o( G: G
, ^' q" V  f. z9 UcchWideChar
' s" T8 K( C% I# ^& YSpecifies the number of characters in the string pointed to by the lpWideCharStr parameter. If this value is -1, the string is assumed to be null-terminated and the length is calculated automatically. ) Q+ X1 H1 D+ m0 V2 L, F
* m4 b. u4 E7 _% W
lpMultiByteStr
3 Z$ }# w! m4 H1 e+ r9 C5 x7 j- JPoints to the buffer to receive the translated string. $ J' {3 A  @3 p

8 k% V- h1 G2 ?) F: P7 \& {cchMultiByte: H( ?3 g& g; b5 E; z
Specifies the size in characters of the buffer pointed to by the lpMultiByteStr parameter. If this value is zero, the function returns the number of bytes required for the buffer. (In this case, the lpMultiByteStr buffer is not used.) ; i( B! V6 L8 V4 m
& a* H( A6 {. \# L5 Y9 A
lpDefaultChar
5 K) E( k. }& [' _1 pPoints to the character used if a wide character cannot be represented in the specified code page. If this parameter is NULL, a system default value is used. The function is faster when both lpDefaultChar and lpUsedDefaultChar are NULL.
. e6 f; m+ e& w# q4 A: S( c/ m8 C: I" d8 B5 ]2 i
lpUsedDefaultChar* K5 w7 |9 y0 g
Points to a flag that indicates whether a default character was used. The flag is set to TRUE if one or more wide characters in the source string cannot be represented in the specified code page. Otherwise, the flag is set to FALSE. This parameter may be NULL. The function is faster when both lpDefaultChar and lpUsedDefaultChar are NULL.   }& W% d, S9 E$ Q) V7 U

4 \/ T5 X7 K8 o, [' y. _) u9 b  l' ~3 O/ y# ~5 a" c4 ^
2 K* ]( _4 e9 H0 _$ t( D
Return Values
2 g1 ^, q1 c+ z; g) m$ u! W
& H, N* O( I, OIf the function succeeds, and cchMultiByte is nonzero, the return value is the number of bytes written to the buffer pointed to by lpMultiByteStr. ( M6 r1 h& }# P& ~" d
If the function succeeds, and cchMultiByte is zero, the return value is the required size, in bytes, for a buffer that can receive the translated string. 2 j( a* z. z  E3 C
If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError may return one of the following error codes:7 D/ D; Y2 s/ ^7 y
$ ^% w8 @- N0 t3 U" u+ X
ERROR_INSUFFICIENT_BUFFER3 N  c; f* p2 z1 K; x( N% n
ERROR_INVALID_FLAGS2 g4 j4 ~* f3 M; X, m9 b
ERROR_INVALID_PARAMETER
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 很美好很美好 很差劲很差劲
回复

使用道具 举报

沙发
发表于 2009-1-21 15:26 | 只看该作者
有应用实例吗,这样看比较累,水平不够 [s:5]
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

冒险解谜游戏中文网 ChinaAVG

官方微博官方微信号小黑屋 微信玩家群  

(C) ChinaAVG 2004 - 2019 All Right Reserved. Powered by Discuz! X3.2
辽ICP备11008827号 | 桂公网安备 45010702000051号

冒险,与你同在。 冒险解谜游戏中文网ChinaAVG诞生于2004年9月9日,是全球华人共同的冒险解谜类游戏家园。我们致力于提供各类冒险游戏资讯供大家学习交流。本站所有资源均不用于商业用途。

快速回复 返回顶部 返回列表