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

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

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

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

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

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

字体、语言相关的API函数原型:
! m3 R" `& w! C# z3 H2 H& M! E7 r/ A; i& \3 M
createFont 用指定的属性创建一种逻辑字体
. g- o( \4 C7 L% Z& F( IcreateFontIndirect 用指定的属性创建一种逻辑字体 % {5 Y7 G- T  V$ S( u0 S8 I+ P2 ]# H
GetStockObject 取得一个固有对象(笔、刷子、字体等). p7 l' Q% s1 v/ o. P
; l" j& J: h- @' D5 ~8 [
GetACP 检取ANSI系统代码页的标识符
3 C% `6 r/ n( E8 O* g5 x* jGetOEMCP 检取系统的OEM代码页标识符1 A, r1 `7 Q$ e% `! \3 H/ U
GetTextExtentPoint 判断一个字串的大小(范围)(用于限制输入)$ `8 Y  g! p6 H# f% P3 b
EnumFontFamilies 列举指定设备可用的字体& V: C& Y1 u' w) `
EnumFontFamiliesEx 列举指定设备可用的字体 ( g# b3 _$ y) G; k8 e1 ^8 q2 X* n
EnumFonts 列举指定设备可用的字体
5 z7 O  W9 Z4 x# m; ^5 x- G$ rGetSystemDefaultLangID 取得系统的默认语言ID 5 H, y0 I+ }/ y2 s  T' X7 }
GetUserDefaultLangID 为当前用户取得默认语言ID' K6 j  z# L, Y* n1 X4 ?- g  ?) ^$ G
GetStringTypeA 获取ANSI字符串类型 ,返回指定字符串的字符类型信息6 {4 A* o5 z2 K3 q  G% ?9 P
GetStringTypeW 返回一个Unicode串的字符类型信息! C. R0 A+ O4 r6 ~% @
GetSystemDefaultLangID 检取系统缺省语言标识符' O8 \) e( Z/ W% d: i
WideCharToMultiByte 把一个宽字符串映射为一个新字符串1 W  p2 {5 H5 A9 V9 r& @& ]2 }6 K

: Z+ J% w3 L8 k! Q=====================================================================
- C* G) I% E5 ]; x, l) O6 f+ @* n2 g8 Q3 O9 U
HFONT CreateFont(
* P3 ~/ g& I$ d8 B) p3 E
! f8 X7 i' v8 Z2 X+ v7 }# W  vint nHeight, // logical height of font
& q* k/ ~8 p" U) k. ~  \int nWidth, // logical average character width , H: y3 C5 [) t
int nEscapement, // angle of escapement
0 P4 O6 ~& t$ x" U- t4 rint nOrientation, // base-line orientation angle
/ a7 R$ u( G- A4 Iint fnWeight, // font weight $ z$ U  J" N) f7 _- Q5 I
DWORD fdwItalic, // italic attribute flag ! B% J2 s; j$ |* g/ y
DWORD fdwUnderline, // underline attribute flag , L& i0 V) B7 V1 |! _
DWORD fdwStrikeOut, // strikeout attribute flag
( m- i2 ^  ^" ~. vDWORD fdwCharSet, // character set identifier
6 ^! x7 H* L: k; t8 RDWORD fdwOutputPrecision, // output precision : ?1 o: _% {% `9 G; w
DWORD fdwClipPrecision, // clipping precision 0 W0 H3 j1 y: v2 h6 ^, b) B
DWORD fdwQuality, // output quality   D0 `* K/ Y) f% u
DWORD fdwPitchAndFamily, // pitch and family ! [; d7 W& }6 p! u+ r9 d, i
LPCTSTR lpszFace // pointer to typeface name string 0 _  G7 T" o# K( t, L0 d% o- x
);
- |$ h0 G% ?" }8 q/ ]/ t, F9 k, X8 ~/ b" n' }3 ]4 }6 B
==========================================================================* x9 V4 \1 r; X- Q6 E% h+ @. a2 q
HFONT CreateFontIndirect(6 ^! S8 ?) d5 f  h* Y4 C7 h
: Y* V, Z9 g' q
CONST LOGFONT *lplf // pointer to logical font structure
7 o) Y& h  e6 b. D; z);4 R1 F& @5 Z( {+ \' X0 G

; P9 L* X3 P$ L==========================================================================+ ^+ k5 r% C* u; |) N1 h" t& f! R
HGDIOBJ GetStockObject(
8 c, M* U* t( m- Q& S6 k5 G9 B5 G" G. j
int fnObject // type of stock object
5 L" E& i/ t0 ?" r, V: m);
# n0 f: U+ i+ _: _7 v* {5 A& p- S; Y' y0 [% r9 x1 Z3 {+ ^* \5 y# Z2 l
: R6 p& z2 a: M3 g$ f8 ^
fnObject
+ `- F* ^* Q4 [( kSpecifies the type of stock object. This parameter can be any one of the following values:
5 u! ^- u2 P. ~5 dValue
3 E' D2 I" z8 t6 z% X5 d4.BLACK_BRUSH Black brush.
! Z  d* W5 d2 e  ~3.DKGRAY_BRUSH Dark gray brush.
" k5 B" @5 \9 {* ^, x. ?2.GRAY_BRUSH Gray brush.
4 }$ T6 d6 [7 `) c& d4 O4 K9 q5.HOLLOW_BRUSH Hollow brush (equivalent to NULL_BRUSH).  @2 E  v7 j6 z3 |! w2 W
1.LTGRAY_BRUSH Light gray brush., [7 N% z; \) ]* m2 S, {
5.NULL_BRUSH Null brush (equivalent to HOLLOW_BRUSH).6 F$ F1 A+ k1 G* b8 ]8 D" x
0.WHITE_BRUSH White brush.
6 H# ]" q0 }2 k+ g" m  Z7.BLACK_PEN Black pen.! w5 v7 U4 ]9 o
8.NULL_PEN Null pen.
( `" Q$ v" ~5 F6 d6.WHITE_PEN White pen.1 s/ e+ E5 K9 _( Y; E- j6 u
11.(0B)ANSI_FIXED_FONT Windows fixed-pitch (monospace) system font.
" w. V1 D6 U' [" Z9 B) ?12.(0C)ANSI_VAR_FONT Windows variable-pitch (proportional space) system font.2 H8 F) Z: Y% N7 e* ]
14.(0E)DEVICE_DEFAULT_FONT Windows NT only: Device-dependent font.
4 m* o: l9 c8 F4 }3 K0 m17.(11)DEFAULT_GUI_FONT Windows 95 only: Default font for user interface objects such as menus and dialog boxes.(一般选这种)
! c7 ~$ J* g7 H' `# n10.(0A)OEM_FIXED_FONT Original equipment manufacturer (OEM) dependent fixed-pitch (monospace) font.5 M* f* }5 T0 h4 l! N
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.
: f6 L  i9 G1 V# U16.(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.% x( n( r8 l; B0 F8 V
15.DEFAULT_PALETTE Default palette. This palette consists of the static colors in the system palette.
9 v& ]* U% p% O8 C& ]/ oIf the function succeeds, the return value identifies the logical object requested.
$ o  l. ^: p+ D  ~If the function fails, the return value is NULL.
, S* I1 T  V% B8 h( U! Z9 S=================================================================================1 F0 ]+ M1 `- o
The GetACP function retrieves the current ANSI code-page identifier for the system.
% I7 j) U3 o3 Q3 dUINT GetACP(VOID)- c; h* a& T( J+ q  a
/ R+ F& }6 O6 l4 A8 e
Parameters2 B* H: J, Z) H9 |% ~
This function has no parameters.
1 m! M; ?0 v1 V% KReturn Values
  n5 r/ j$ |, C- a% o' p: ^If 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.+ W7 |, R- D7 M' @, T( k
Remarks0 \" g* X# C6 H' H# m
Following are the ANSI code-page identifiers: # [! U* p1 y9 r9 d$ J: }6 o0 J, K
Identifier Meaning
) k/ o& r2 ?+ P( O' B! b( r874 Thai
: d7 d3 S- C  i0 d) |  N932 Japan
" Z2 W8 V, {  {6 q0 x9 p( V2 @+ Z2 i936 Chinese (PRC, Singapore)' H2 o; j- x$ e8 B$ q
949 Korean
6 S0 Z; }' D' f7 N950 Chinese (Taiwan, Hong Kong)
4 b5 ]0 J  H" x6 o; B1200 Unicode (BMP of ISO 10646)6 l8 k8 o. H+ W
1250 Windows 3.1 Eastern European 6 M" K- u/ i+ S3 f- M
1251 Windows 3.1 Cyrillic, Q! T! O* ]6 u2 h
1252 Windows 3.1 Latin 1 (US, Western Europe)
2 \) m: S8 }$ w. h/ G' C2 H1253 Windows 3.1 Greek7 F2 P0 E2 ~& |( a$ e0 c7 o
1254 Windows 3.1 Turkish" G, ?; s: V8 J6 Z% c6 |
1255 Hebrew' q8 G% _& G" @5 |& {6 a
1256 Arabic
& q1 b7 k: m- `4 v5 G$ b1257 Baltic) I, x" _& M: M2 }
=============================================================================
0 }- J8 D; a: ]% H! Q. k9 l( h# WThe GetOEMCP function retrieves the current OEM code-page identifier for the system. (OEM stands for original equipment manufacturer.) . N/ g5 _+ ?: Y& `- W
. Y8 j3 a: x" ?: T- P# {0 K
UINT GetOEMCP(VOID)2 o1 f2 H( G( N, E# M5 W3 F) y% A$ F
  Q/ U+ }3 N& I; S5 d9 v& ?. _
) i& \3 u7 H5 m7 ]. H1 _
Parameters% F- H8 I$ }4 I+ |# T) r4 S
3 {( d: w1 N( |- M
This function has no parameters.   `% S% K- y2 \3 d! w' m
  W- n# w% o% z# n4 I' E# T
Return Values
- y5 U8 C+ m3 c6 i. `9 {6 T+ {" u
' o, G( S4 P# R" q* c# XIf 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.1 l$ Q) h" X, c! `" `0 ?7 D# g

9 h3 a4 h3 c1 m4 qRemarks: `4 x9 ^* d  s  h: [
# y. O6 s  }7 y  j+ ~* r" L
Following are the OEM code-page identifiers: - J7 g; w" }( `! o( X
7 V6 m! Z/ ?0 M+ j$ I% h
Identifier Meaning, I) U( U; b+ r0 P8 f! Y+ B
437 MS-DOS United States
  x0 |* o. I6 {3 w; M) g708 Arabic (ASMO 708)* D) E: `$ n: ?8 k: ~& Z! V
709 Arabic (ASMO 449+, BCON V4)* G) u7 |* u, K( Z% J+ u) a
710 Arabic (Transparent Arabic)
- y( ?6 @5 w3 I9 b, A" S720 Arabic (Transparent ASMO)
, t$ b) R! M& h4 f$ y- c737 Greek (formerly 437G)! G* J2 N0 C3 L% |  J# b0 |9 @$ r
775 Baltic
0 s0 h6 [& I' y' C4 W850 MS-DOS Multilingual (Latin I)# l2 ^  V) \$ M6 w. l; B
852 MS-DOS Slavic (Latin II)
5 Y0 m, N" d7 L8 P; U855 IBM Cyrillic (primarily Russian)) U0 _. |% v1 k$ C: {, c. r% J
857 IBM Turkish
2 W  `- H4 e* G. ?4 z' [860 MS-DOS Portuguese
, C) ^" u( W+ s7 v+ P" u. k  b861 MS-DOS Icelandic: V0 T" X8 L5 E) w& u4 u4 X$ R0 }
862 Hebrew
( F9 v! G% ?% I2 F863 MS-DOS Canadian-French
/ C6 |# q( v6 h. y864 Arabic, G% w  ]  j; P1 _* `$ \
865 MS-DOS Nordic
1 E- {1 C+ E) @* U. w2 G3 e1 r5 F866 MS-DOS Russian (former USSR)  s5 P6 K) d- ]) `. b
869 IBM Modern Greek- K/ u; j& [6 Q. K/ i8 Y' X. I8 I
874 Thai
! x* ?* j# M) O6 E8 {932 Japan3 e- O5 o4 g+ i( q5 \  [- K7 \( T" h
936 Chinese (PRC, Singapore)
- p# y: S4 h% v( I949 Korean
+ Y# ?  `2 \/ Q. h. c/ c" x+ E" {950 Chinese (Taiwan, Hong Kong)
6 M* O0 I( d/ h1361 Korean (Johab)& Q, g% O& x$ G( r9 v, {! q. e
===============================================================================( c( k2 Q" z3 j3 j( p; h
BOOL GetTextExtentPoint(
; G% W6 K( j6 g+ X" K* X2 j1 d. i: O
HDC hdc, // handle of device context % T1 h9 X$ A# e. l
LPCTSTR lpString, // address of text string " T4 H. Y; V. x* w2 A0 J
int cbString, // number of characters in string
) T* {" j9 p; a7 ]LPSIZE lpSize // address of structure for string size
% h. ?: \9 s8 b3 A& g# s);5 F; z: `: M  p$ R8 M9 Y
===============================================================================$ A0 \  g3 q# H4 {+ e0 u8 K
The EnumFontFamilies function enumerates the fonts in a specified font family that are available on a specified device. This function supersedes the EnumFonts function. ' R5 m3 m# T# D# r
int EnumFontFamilies(4 j% ?& {- @% u& B( V- l( F
HDC hdc, // handle to device control 4 h5 q$ t0 P* o; Y2 Z) g9 Y; h1 Y
LPCTSTR lpszFamily, // pointer to family-name string   I1 N. S4 `/ c0 ~
FONTENUMPROC lpEnumFontFamProc, // pointer to callback function
# F; d& X. X$ m% q/ e2 L+ R* eLPARAM lParam // address of application-supplied data
4 V9 z+ M; p  V& p);
! n; T1 v, e# ?0 }% \9 j
. e/ R# F, P' m" I' ~1 FParameters! F* g1 U& w- Z0 n2 ]. ?4 |1 F
hdc
4 k* c3 g; h8 l1 tIdentifies the device context.
* I( n/ P( P% h0 ~+ klpszFamily% V% a! K. a; ~2 }1 ?
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. ( e4 U0 }( [& {7 |7 o% p
lpEnumFontFamProc( q  u" }1 ]& ?* O& K
Specifies the procedure-instance address of the application-defined callback function. For information about the callback function, see the EnumFontFamProc function.
. D7 S! n, N/ O  \lParam
% e* |) v- {& o6 IPoints to application-supplied data. The data is passed to the callback function along with the font information. " b1 }$ X1 Z: }& f

- X! q; A: X7 A8 u* h7 |Return Values
* q, H, p, t' n. ?& c; _6 NIf the function succeeds, the return value is the last value returned by the callback function. Its meaning is implementation specific. 2 y: w3 Y$ E2 F$ w
=============================================================================! o+ R  ?: d' E
The EnumFontFamiliesEx function enumerates all fonts in the system that match the font characteristics specified by the 1 N0 [$ t; I" E1 t0 W, F9 c+ x
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.% \/ n4 U  C( @7 V& H
3 K, ~9 v5 ~  r- \& D5 W
int EnumFontFamiliesEx(
% w  w1 a2 v% D/ y, H) l6 ]HDC hdc, // handle to device context
. O. o. h4 Z+ g) U9 |- M: RLPLOGFONT lpLogfont, // pointer to logical font information
1 Y) c8 i1 h6 S% G. _FONTENUMPROC lpEnumFontFamExProc, // pointer to callback function3 S' m2 ~% u/ c" W0 Z
LPARAM lParam, // application-supplied data6 @- h. y; C. f  X. F
DWORD dwFlags // reserved; must be zero
/ l4 k5 c/ Z1 x( z9 h) v);) L3 t6 {. ]5 r) H8 y8 ]
=================================================================================) R: X2 s1 ]0 |$ J% E2 Z* f0 ^
The 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. 6 e/ Y6 E& k. P& \
This function is provided for compatibility with earlier versions of Microsoft Windows. Win32-based applications should use the EnumFontFamilies function.# R$ o, V5 L: V1 n

  A- c- \% L# v0 j& m, ]) V/ S$ @, Vint EnumFonts(9 n; k  |, a  Z7 ?/ O+ S
HDC hdc, // handle to device context
% q: |4 Q/ S% Y/ q& J$ Z, s: xLPCTSTR lpFaceName, // pointer to font typeface name string
9 o; k# u5 D; A! r: U" ]FONTENUMPROC lpFontFunc, // pointer to callback function 4 K7 p; O$ G' H: G( H
LPARAM lParam // address of application-supplied data ' x, Q1 D- f" M2 f$ C( \0 H8 U+ P
); , H2 a7 [, D( n
' O) |2 P% J! _1 T
Parameters+ X# N3 h' S8 H0 s7 H2 Y7 K1 b' r$ Q
hdc8 p2 V" n( Z1 @! d7 t
Identifies the device context. : k7 s2 C. X+ `) r& ~8 y4 j( E
lpFaceName, F, g0 B( f5 n" |8 q4 D
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.
: G2 I) y5 ]5 h: K* dlpFontFunc
: j0 p- x; d: q: {2 a0 RPoints to the application-defined callback function. For more information about the callback function, see the EnumFontsProc function.
5 k4 [. ?3 M) [5 P) {9 y9 u3 G+ N* XlParam/ t* Y, b% H" P7 C( O9 z
Points to any application-defined data. The data is passed to the callback function along with the font information.
  C. g0 r3 I5 W  Q! s
; {6 q; @) E, p: u$ w1 `% L; O. d' @, Z! s+ L. ]) a
Return Values
. F1 s3 C9 m3 z' {+ x0 x! HIf the function succeeds, the return value is the last value returned by the callback function. Its meaning is defined by the application. " P, ^1 A. x& K& j
======================================================================
! z. P% b) z/ E" M1 x7 cThe GetSystemDefaultLangID function retrieves the system default language identifier.
# |( F! r9 t4 J7 u% E& A' {- Y! i3 M. W) F, P* s1 o
LANGID GetSystemDefaultLangID(VOID), i- r; h# M. P* A

: |. h: R3 q' e% j" k* X. LParameters
  o  n) s  J( Q4 d* g3 e6 |# h7 }This function has no parameters.
( y1 L/ u# P8 y8 hReturn Values( }% D( M/ N' e( F5 n6 W* S5 r) Z
If the function succeeds, the return value is the system default language identifier.) V1 d% Y: A8 d- N/ ?- q( ^
================================================================================3 w' [8 u( Y$ O
The GetUserDefaultLangID function retrieves the user default language identifier.
3 y7 b7 g+ d& S
& J4 F5 ?5 J: `* g& o- ~LANGID GetUserDefaultLangID(VOID)
3 n, v6 h- Y2 J& i
/ o" E& V) [( M, l) OParameters
# h, V# [5 w5 j4 M- OThis function has no parameters.
; D  G3 V- d5 FReturn Values
9 \0 v0 x7 k" C5 {5 RIf the function succeeds, the return value is the user default language identifier.) U# J1 Z  d& r# _' t; \( c. ~
================================================================================
$ Y0 k, j1 X8 ^3 r4 H( n8 @
/ I$ z" O6 f% j( MBOOL GetStringTypeA(( u  y) d# W7 a* u

2 I4 E. q/ ~/ MLCID Locale, // locale identifer" w- K; w4 o: ^6 M
DWORD dwInfoType, // information-type options 0 H$ T% ^5 f1 k3 F6 l  R
LPCSTR lpSrcStr, // pointer to the source string
! y+ {6 p4 |- y0 A; uint cchSrc, // size, in bytes, of the source string
- i6 \# o' w6 [& qLPWORD lpCharType // pointer to the buffer for output $ a, [$ D; e) }# p! U7 K/ S) k
);. A( b" Y0 n6 l8 o* J
Parameters
2 j1 _! i9 s) v* o& q; U) q, lLocale9 O" r  B( P3 [
LOCALE_SYSTEM_DEFAULT Default system locale
, ?1 h: u) t, n! @LOCALE_USER_DEFAULT Default user locale6 l2 n. w. ~( [
dwInfoType
! ^1 e; \2 }! R- `CT_CTYPE1 Retrieve character type information.) v+ t+ r9 l; ~& Y
CT_CTYPE2 Retrieve bidirectional layout information.! l* I9 k! \; u6 n0 O9 }
CT_CTYPE3 Retrieve text processing information.
! W& I) t* t6 D8 q* TlpSrcStr
* c1 g- f% ?  G2 z. jPoints 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.2 x/ v3 ^- q9 ?& g; V+ E
cchSrc
( d% l5 @5 t) u, O6 |" q: G. fSpecifies 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. & X9 L. L0 n# p
lpCharType0 |8 w2 q! n$ s! b; n& d/ B! a% D$ y
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. 3 d  [" x/ |2 b* ^$ S' \8 V/ }  P3 y* }
; a3 w3 Q( a+ Z4 F6 h
Return Values7 N4 p; x6 _9 l1 G+ A
If the function succeeds, the return value is nonzero.
% z# n" E. z2 M7 A* r+ n7 Z=================================================================% ^: \  `: b4 T, Z6 Z) h
BOOL GetStringTypeW(' E* e6 X' u0 b. f7 K

3 w: n- Y/ l. u' A$ f$ y0 p1 d9 _DWORD dwInfoType, // information-type options
6 h& S. R- E9 U  O! M6 L6 LLPCWSTR lpSrcStr, // address of source string 5 b  e& g8 o' z* a" V' h
int cchSrc, // number of characters in string
# n# w' a6 Q% ?( z$ m1 |6 s$ ELPWORD lpCharType // address of buffer for output
; j, n/ r1 J$ G& Y4 D);9 j1 z1 q! t2 J6 n+ e: O
==========================================================================
8 n+ u  S$ L" ~The GetSystemDefaultLangID function retrieves the system default language identifier. ! _2 l/ J4 [% r8 v
LANGID GetSystemDefaultLangID(VOID)8 o1 J5 b. f* O  Z
2 \# d% u  T3 r" J' h" s) {

1 {- ~- o2 F5 \- Y; R% u' AParameters
# Y0 w0 y; U4 \' M, wThis function has no parameters.
3 H/ K- t% d9 _, Q
1 z7 J# w8 e2 z8 ?- s. W2 TReturn Values% p- E6 g& b8 p, @% O8 ~
If the function succeeds, the return value is the system default language identifier.. T3 s" |1 L" p

8 ~2 a% z$ ?+ HRemarks
: o5 q  j/ ?6 i5 C1 T7 h& lFor more information about language identifiers, see Language Identifiers and Locales.
8 P1 M$ I5 G! q/ v===============================================================================
4 V( ?4 a' G, s- S8 ~int WideCharToMultiByte(* ^" ^" ^% [+ e8 t7 d

+ L0 _; g1 H6 F$ @5 t5 s/ Y+ ~UINT CodePage, // code page
# v5 h! C- u$ i  K' @7 F' e8 ^DWORD dwFlags, // performance and mapping flags
; k* J3 e* y9 G3 L8 kLPCWSTR lpWideCharStr, // address of wide-character string ( W$ k* {) @, }9 f' o9 Y2 w8 r
int cchWideChar, // number of characters in string
4 s/ i- N5 Z# J, Q& RLPSTR lpMultiByteStr, // address of buffer for new string
8 I* M/ h. k4 Y' q5 d3 W- ^: rint cchMultiByte, // size of buffer
0 o1 v- H3 f" d; BLPCSTR lpDefaultChar, // address of default for unmappable characters
& y6 r/ `( l4 r2 T8 JLPBOOL lpUsedDefaultChar // address of flag set when default char. used - M) `+ H: L3 d) H/ f+ L( ^8 h5 e1 m
); : b1 J( }5 P8 e% G

2 _1 O8 M% u" I# _+ M7 O$ o* p8 f
! k* v& J6 R+ {- c- y) N  jParameters, y$ \% A1 D: T5 H
% P% J# H+ P6 n6 q/ L  d, y  x- [
CodePage
) @" l0 [' T* G- bSpecifies 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: ) F8 l" i% P. D$ A  q

- z" z. x5 a% zValue Meaning
) R6 E3 o5 V9 N# fCP_ACP ANSI code page
1 M$ p4 V6 {0 @, sCP_MACCP Macintosh code page
2 ~3 H! T. w/ W7 R0 [! C4 F0 P% tCP_OEMCP OEM code page
* g4 \0 j: ~5 u7 u2 C, q
1 A: a& A* @( ^dwFlags0 W! K- B8 ?+ \% {% H" G. U$ G
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:( a3 {# O% u- G/ `8 c" S

. {* r- M" @0 P; eValue Meaning
3 y9 b- `; r9 X1 P" {WC_COMPOSITECHECK Convert composite characters to precomposed characters.
. q' x/ k" q: z8 _# `0 F. vWC_DISCARDNS Discard nonspacing characters during conversion.0 `4 J+ y% `0 [+ Y4 B. w, q' b6 J
WC_SEPCHARS Generate separate characters during conversion. This is the default conversion behavior.; s8 h8 |  T# }% f
WC_DEFAULTCHAR Replace exceptions with the default character during conversion.2 C* d+ j  n2 z( `' w& p
( I: p$ |, C2 k
When 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 5 T; F+ A2 \+ P0 X1 {6 l) i: V
e is the base character, and the accent grave mark is the nonspacing character.$ S8 X/ l! Z2 p
, C' j7 O' o' |, F/ \
When 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.7 D  U4 D" n$ _
The functions default behavior is to generate separate characters (WC_SEPCHARS) for unmapped composite characters.. N5 [# L# D& j% I! N6 S2 \

5 I. [' @) ]( [4 alpWideCharStr
- B7 S" e: Q: p5 c" J# uPoints to the wide-character string to be converted.
9 s. Y2 {: L2 ^( r4 }2 x5 F7 a+ i/ H
7 q( Y4 m$ y9 ], a7 n% Q# ccchWideChar
' ]& r9 m3 g2 a2 D/ R4 mSpecifies 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.
0 e. y# Q; X; I5 R8 v
+ \. Y& p9 O/ a5 z( ~8 {lpMultiByteStr, p3 @2 W' J1 O$ q
Points to the buffer to receive the translated string. 9 N. Z5 z) p- [5 M# ^

$ V( D: o3 G9 E0 _; }9 P! c2 ucchMultiByte
; K8 I1 j8 d! dSpecifies 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.) . q- T4 U) H$ k/ p! L: J# G" L' ?

  _6 n! v) o" flpDefaultChar3 I' R) A  Q  w* w2 R  {
Points 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.
* Z4 |  [3 F: h8 _8 J, |, y7 n
/ N3 j. F" l7 NlpUsedDefaultChar4 A( x- q0 k, g/ [( @7 Z, ~+ f- _1 w
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.
" }. i2 I  q* U( l! H
( R, ~9 D2 ?2 H8 E) ~5 b* o* Z. f" D' }

% G5 w6 o2 Z0 g' O' y3 F4 [Return Values
% l/ T/ Q& m2 X) K0 L# s8 O
* @1 P, q7 s/ h& |) u' BIf the function succeeds, and cchMultiByte is nonzero, the return value is the number of bytes written to the buffer pointed to by lpMultiByteStr. 6 @/ P" k4 G% F7 }) l: \
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. % e5 q! u$ V4 F' O
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 P: J4 o; ^& `
* {' k( Z6 i7 d$ Y, `ERROR_INSUFFICIENT_BUFFER( ~: m, n* j: q) I: d1 U  P
ERROR_INVALID_FLAGS
* ~) h# |7 J/ S- a6 UERROR_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日,是全球华人共同的冒险解谜类游戏家园。我们致力于提供各类冒险游戏资讯供大家学习交流。本站所有资源均不用于商业用途。

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