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

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

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

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

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

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

字体、语言相关的API函数原型:
" A* V* v  H  ]( K- P1 `, R! |7 \* r6 v. m2 P9 J4 G8 f7 |. Q, W
createFont 用指定的属性创建一种逻辑字体 4 h" [' G2 H; A' x- c, G# f
createFontIndirect 用指定的属性创建一种逻辑字体 ! K, y& m3 G' l5 X
GetStockObject 取得一个固有对象(笔、刷子、字体等)2 g- a9 [) w! v5 U& o% G( w
% f, W4 y  M  e6 T3 }8 n
GetACP 检取ANSI系统代码页的标识符
& K2 G! b  h+ x; k0 s* ^- j9 RGetOEMCP 检取系统的OEM代码页标识符: r7 `, V4 }( N
GetTextExtentPoint 判断一个字串的大小(范围)(用于限制输入)" {& B$ {2 s# R6 H5 n# h5 B% S
EnumFontFamilies 列举指定设备可用的字体7 h! ~; c6 n: B# h- V& `" V
EnumFontFamiliesEx 列举指定设备可用的字体 2 c* g! K! b7 Q5 a( R2 R
EnumFonts 列举指定设备可用的字体
4 Q( \! K; x" c$ Q+ R9 eGetSystemDefaultLangID 取得系统的默认语言ID
$ k2 {5 i3 I+ }% r% uGetUserDefaultLangID 为当前用户取得默认语言ID
# B1 m# Q- w6 g7 L% T0 S4 [GetStringTypeA 获取ANSI字符串类型 ,返回指定字符串的字符类型信息+ t- b2 t7 s  h8 m' t$ H
GetStringTypeW 返回一个Unicode串的字符类型信息- V0 z5 ]/ B8 I( w, f! E
GetSystemDefaultLangID 检取系统缺省语言标识符$ i2 t2 E3 _* |7 ^/ e5 j
WideCharToMultiByte 把一个宽字符串映射为一个新字符串
' W8 g  d  @  }9 C: p/ I0 h
: ?- `  c  r- O5 z: \0 R+ i$ ^=====================================================================
9 H3 N$ D1 E' v) S0 {( U' [
) f  ^6 V2 S; P1 c! i$ THFONT CreateFont(; O! M, O3 S( ]7 b" y1 V7 b. {

! x, N2 m) J: Z1 M; fint nHeight, // logical height of font 6 Y- F7 Z- v* P+ }$ Z
int nWidth, // logical average character width
: P% r* Y4 \# ?3 m0 [1 E# O5 sint nEscapement, // angle of escapement # j- N: I( [- ]  `3 o+ Y
int nOrientation, // base-line orientation angle
7 J4 u8 {) a5 h& k8 R5 F. G% bint fnWeight, // font weight % q; o7 b7 j/ l# e: e
DWORD fdwItalic, // italic attribute flag 4 `3 [) W# @4 P& \+ l! ~
DWORD fdwUnderline, // underline attribute flag
, T: f/ a. e/ j* DDWORD fdwStrikeOut, // strikeout attribute flag
, ?# ?0 e* X3 mDWORD fdwCharSet, // character set identifier
( O$ `7 c# e) n- ^. `4 Z: sDWORD fdwOutputPrecision, // output precision
2 a# U  P, i" ]; `* hDWORD fdwClipPrecision, // clipping precision 5 J1 ^7 `' G9 N2 Q
DWORD fdwQuality, // output quality - b8 N; t' E9 d; L0 l: q! }/ Q
DWORD fdwPitchAndFamily, // pitch and family
  P, m  T( F7 X# KLPCTSTR lpszFace // pointer to typeface name string
" D$ e$ `0 q, Q) R0 j" o3 A8 E);5 f6 a8 z& u5 B  |# T
* G3 Q8 D. v4 v. t
==========================================================================: C" k- g" [2 g/ m
HFONT CreateFontIndirect(3 `" e: ?7 G0 x* x+ S! {
7 ^0 l3 l/ r6 F. V% `% I1 [8 y/ E
CONST LOGFONT *lplf // pointer to logical font structure ) w3 x& W+ ^1 Y5 |# C, M
);/ S) Q9 S, Z! h- o3 G

# ?/ _0 v0 R' G6 x$ d==========================================================================
5 K& m$ }6 e& r% pHGDIOBJ GetStockObject(/ i+ R3 _: y2 p* b( j  I

2 k1 y$ j7 V- }int fnObject // type of stock object
! C" l5 S: \, s5 s3 I) @);$ X: Y3 P7 l" v' q) Q% H

3 n+ t$ Z8 c6 [; v
8 {) z0 l& g7 ]& sfnObject& F3 e: l- g. B3 N% v5 d
Specifies the type of stock object. This parameter can be any one of the following values: ( L1 P/ S1 I, j& D' T
Value
5 R+ ]9 }  O: @# ?% Q6 w4.BLACK_BRUSH Black brush./ V, Z" a) l7 G: W! X
3.DKGRAY_BRUSH Dark gray brush.
! v% ~& v( J2 k* }4 ]4 P( j+ e! L2.GRAY_BRUSH Gray brush.- Z' p# P0 [+ g5 K! o
5.HOLLOW_BRUSH Hollow brush (equivalent to NULL_BRUSH).
4 B4 a% ?& I6 b3 q% X( h' S# r" a1.LTGRAY_BRUSH Light gray brush." B. c+ S$ _  E8 C
5.NULL_BRUSH Null brush (equivalent to HOLLOW_BRUSH).& C; n0 n- J3 e
0.WHITE_BRUSH White brush., h2 C6 r+ ]* v
7.BLACK_PEN Black pen.
1 s( w4 Z! f4 Q  a8 h% O8.NULL_PEN Null pen.1 v( R- }6 ~/ D& n' x" c' N
6.WHITE_PEN White pen." S. v% _  z5 d! @' P
11.(0B)ANSI_FIXED_FONT Windows fixed-pitch (monospace) system font., v' N0 m5 @  Q7 _, C
12.(0C)ANSI_VAR_FONT Windows variable-pitch (proportional space) system font.
5 L2 O3 B* |! x14.(0E)DEVICE_DEFAULT_FONT Windows NT only: Device-dependent font.; |9 S) _9 p( D
17.(11)DEFAULT_GUI_FONT Windows 95 only: Default font for user interface objects such as menus and dialog boxes.(一般选这种)
" c& P0 ]4 e& X8 b$ o10.(0A)OEM_FIXED_FONT Original equipment manufacturer (OEM) dependent fixed-pitch (monospace) font.
$ Q/ b1 V$ l: n$ J1 d  z13.(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.
2 E4 R8 g: a7 T3 S! V8 s8 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.
8 [" E% r8 y& |- P  T! p15.DEFAULT_PALETTE Default palette. This palette consists of the static colors in the system palette.
# O0 X  B+ S% V, F4 ]4 _1 sIf the function succeeds, the return value identifies the logical object requested.) i6 x4 K- E1 C4 @. e6 B' R
If the function fails, the return value is NULL.
$ s- {9 w0 A% k9 z=================================================================================! i& z# T+ v. Z) \$ Z4 o8 \
The GetACP function retrieves the current ANSI code-page identifier for the system.
3 D* X" \0 Q" J- `7 p& F, I# nUINT GetACP(VOID)
: l% e. q* p' f, ~
2 v3 K& x5 v: f' \/ S: u5 yParameters  D! M. W  Y: V0 @; }  ?1 E
This function has no parameters.
2 {, S6 f) \( tReturn Values' t  w% M. r; X0 y8 {! Y" w
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.
: G1 o8 y" Q; s8 Q- v. @6 O5 SRemarks7 ]+ E) M9 @6 ?, x! y
Following are the ANSI code-page identifiers:
( R$ M* R. `6 L* Y' w1 UIdentifier Meaning
; T/ d. x: m% R6 s  j* Q) ^874 Thai
1 Z2 k% W. F! P- _3 G: d4 |932 Japan! j; U6 K4 ?9 A
936 Chinese (PRC, Singapore); k4 M5 x4 L3 R# u9 d$ |4 U
949 Korean* T# b' u% @6 M! [7 |
950 Chinese (Taiwan, Hong Kong)
- F! @9 j  R. y$ n  x1200 Unicode (BMP of ISO 10646)1 m0 t! `4 I, _4 Y; r
1250 Windows 3.1 Eastern European
) x$ j7 R  G4 z  B2 v! i# G* y: z& D1251 Windows 3.1 Cyrillic
6 v3 T' f  p5 ^6 ^1 H/ u1252 Windows 3.1 Latin 1 (US, Western Europe)  x' o6 e2 O( d2 R; Y* o
1253 Windows 3.1 Greek, B5 v: v' e! s  W
1254 Windows 3.1 Turkish
; |3 V) E1 G' x) I7 ~4 f1255 Hebrew1 f* Z. x4 a! {# W! C
1256 Arabic
. L+ T0 R$ B2 Q1257 Baltic2 {$ _$ [7 S% ^2 j/ A) l# `
=============================================================================9 |* L/ X! `7 U8 R5 L) q
The GetOEMCP function retrieves the current OEM code-page identifier for the system. (OEM stands for original equipment manufacturer.) ! u+ c  |2 T+ O

  y! j; w9 v* M, A) z/ oUINT GetOEMCP(VOID)
+ q: x; @" j- R- ~" l" o: h1 a) q( m0 @' }! i3 {' k& r7 X9 ^
$ d1 K) [4 J$ L3 F5 T
Parameters
  z& Q' R3 k: [" A( J
8 {$ ?/ q/ s# F! ?- D3 cThis function has no parameters.
* R* k* Z  \3 ?: A4 G5 w" t4 F$ r( f
Return Values
5 V" b: a4 ?  w' \5 x) i4 w3 h) Q7 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.
4 E5 M; F; l' }  z) \1 r0 H
* z4 u0 O) Q$ o9 \Remarks$ L8 R- q0 z( u
' Z  V/ O$ K9 y5 q! {
Following are the OEM code-page identifiers: & |4 O+ u# \7 g3 S) A1 T

& c% q* W* _3 P! E1 [2 FIdentifier Meaning
( |7 B: _0 ]9 K4 c2 S, z7 I437 MS-DOS United States
- j6 Q: V4 w- g, O708 Arabic (ASMO 708)
0 e$ P9 [$ x/ h. e. V& q7 S% N0 ?6 _709 Arabic (ASMO 449+, BCON V4)  C* n0 {7 ~7 P: N
710 Arabic (Transparent Arabic)
2 B1 s6 k! R6 o9 F1 y720 Arabic (Transparent ASMO)
$ E, v0 Z( O! p3 A737 Greek (formerly 437G)
6 H4 i4 W2 }  [: ^# ]) ?' Z* s775 Baltic  D- h: [! a- H% S
850 MS-DOS Multilingual (Latin I)
- h/ D% t( g9 C- `4 h852 MS-DOS Slavic (Latin II)
# z9 N, y6 u% S$ v3 z7 W% g855 IBM Cyrillic (primarily Russian)
7 D& Q# o4 Q& j! f- U+ c857 IBM Turkish# U/ r/ |' ^: @/ ^/ h/ B+ B
860 MS-DOS Portuguese
  l9 I1 z. ~# P) P- ^$ A0 ^861 MS-DOS Icelandic
2 y. r; s- Y- Y& {* l/ R) g862 Hebrew
" ]% l! m) E4 }  V& Y- |863 MS-DOS Canadian-French
$ C9 a5 I( ^, G  m864 Arabic( o2 N1 k3 Y# {7 W7 r
865 MS-DOS Nordic6 h. m. ?' ]8 |) j+ j
866 MS-DOS Russian (former USSR); Q9 u' D; b( ~' B
869 IBM Modern Greek% |; k9 D% Z3 y4 ?# i# e. t
874 Thai
5 r3 L3 `* H- R1 L; a, o932 Japan2 O+ y, j' J' @5 b4 ^
936 Chinese (PRC, Singapore)
% B& J7 i: }7 Q+ U  c2 k! d& D949 Korean
  K: Y$ m, p- i& L- r2 H$ D0 k% @2 h950 Chinese (Taiwan, Hong Kong) - r* \  Y/ }2 ^% b
1361 Korean (Johab)' k: r) b& X( N: q% C, K# k0 z1 A/ O
===============================================================================
7 i' K" G4 R  v. P. e, u7 |! jBOOL GetTextExtentPoint(
5 [- l! f% D$ X" H) w2 |7 c) [. R* x- C3 h* u
HDC hdc, // handle of device context
- T# I7 m% A9 {  n' C0 ]( I6 \; DLPCTSTR lpString, // address of text string ) h  x9 ]8 S; f# B1 g/ A. X0 n
int cbString, // number of characters in string * {7 H3 |8 b: d! H; G
LPSIZE lpSize // address of structure for string size 2 p) M  K0 s- {3 l
);: c/ {6 Z6 E( r- x" a
===============================================================================
. v+ H6 D8 ^) GThe EnumFontFamilies function enumerates the fonts in a specified font family that are available on a specified device. This function supersedes the EnumFonts function.
2 F$ U+ z% c0 T; q6 a& s# l' aint EnumFontFamilies(  Z8 v  x6 w' E' z6 W
HDC hdc, // handle to device control
* z( x/ p: I8 ^$ V! Y) e* dLPCTSTR lpszFamily, // pointer to family-name string
; F8 G+ g3 q6 J+ XFONTENUMPROC lpEnumFontFamProc, // pointer to callback function
* J9 r- K8 x& gLPARAM lParam // address of application-supplied data 8 U" K: C: q/ e' n
);# d7 d1 ?; a5 N0 T8 K
- o/ t9 U  m( U0 o$ o' J  t2 i7 t
Parameters- E# L- Z2 x$ m  q' V5 `  `7 F
hdc( J6 p( B- V1 c1 ^0 J
Identifies the device context.
* g+ b- m# _) p4 F( o. klpszFamily# p3 ]% @& Z% g
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.
9 e' j$ L& x$ Y3 \lpEnumFontFamProc" `  k( o" H/ v, h0 [
Specifies the procedure-instance address of the application-defined callback function. For information about the callback function, see the EnumFontFamProc function. - |4 I6 W6 Q6 L! M# N
lParam
. |1 e. E9 d# I, c) v* {Points to application-supplied data. The data is passed to the callback function along with the font information. 5 \% E" E, e+ r6 H0 u

* B9 q) J& X2 \6 rReturn Values; a7 d8 C- G7 s. G& C
If the function succeeds, the return value is the last value returned by the callback function. Its meaning is implementation specific. $ v3 A( v3 t1 a% v% q3 u$ `
=============================================================================
! F4 n. Q! O, Q  x: jThe EnumFontFamiliesEx function enumerates all fonts in the system that match the font characteristics specified by the
8 k- r$ k1 T% tLOGFONT 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.# `, _  }7 J2 t. ~) c: Z! k& ]
# u7 u) M0 R5 k! [3 ]& [& u. P; b' Y
int EnumFontFamiliesEx(
' u, t& q4 }. R* e$ yHDC hdc, // handle to device context
. n& b( u) S/ L7 [7 ]1 A" RLPLOGFONT lpLogfont, // pointer to logical font information6 y* |5 j- s2 @) K9 E+ a
FONTENUMPROC lpEnumFontFamExProc, // pointer to callback function
) }% @0 X6 @, r) u) i& ~# ~/ p8 OLPARAM lParam, // application-supplied data
/ J! g. @3 X/ P: \3 Y0 w$ Z, _% p) FDWORD dwFlags // reserved; must be zero; o( ?9 H% t% r( J4 `+ i: c6 v/ p
);5 ]0 l9 L& ?* h8 O1 M0 y& x
=================================================================================0 Z/ x1 `% g* Q
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. & V' l5 J0 `/ P9 Y
This function is provided for compatibility with earlier versions of Microsoft Windows. Win32-based applications should use the EnumFontFamilies function.
/ N% |4 ~" A& r! P: Y- Y
3 C0 @! y, x' F! Vint EnumFonts(
% |% s; U! R+ J' nHDC hdc, // handle to device context 2 f( ]3 L' `8 l/ L
LPCTSTR lpFaceName, // pointer to font typeface name string
# D' C- x7 e$ k0 I9 k, I' AFONTENUMPROC lpFontFunc, // pointer to callback function
) x9 @9 P) v3 G- A& iLPARAM lParam // address of application-supplied data
$ d7 @. P- z$ |);
5 c' E- |+ V$ X+ q1 p+ _3 U: A' y9 ~3 K9 a. b4 T8 t
Parameters$ O1 O7 u* M& g$ R
hdc
4 G3 W( V( y0 Z1 K. s. T% wIdentifies the device context. " x* ^! e# t$ B1 h2 e9 \# P1 P
lpFaceName
4 k% G$ P$ t' i* JPoints 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. : U- ?2 r# u% Y
lpFontFunc
4 H+ n3 S9 P4 n* F& hPoints to the application-defined callback function. For more information about the callback function, see the EnumFontsProc function. # O7 |* s9 ]; z; D
lParam
  I7 N" }. x' {: W1 ^Points to any application-defined data. The data is passed to the callback function along with the font information. 3 A- @' O- b; x. }& d" O* w
9 P3 T" G& |) ?

8 M7 s: z. R1 tReturn Values
& M, |& d, E) CIf the function succeeds, the return value is the last value returned by the callback function. Its meaning is defined by the application.
  `7 l! y% j3 P+ @9 P9 M======================================================================' T  W7 \. B2 X4 @9 f* P& t
The GetSystemDefaultLangID function retrieves the system default language identifier.
# Y9 t/ H$ C! N9 V$ f; ~
5 \6 U$ U/ X3 p4 NLANGID GetSystemDefaultLangID(VOID)
% r7 k+ e* S, O$ r9 G, B' C! m/ C7 A2 k* t
Parameters; f- i4 i4 r; ]' i+ e# N7 C* E! \
This function has no parameters.
& W% H  s* F1 _Return Values
1 y$ a1 c2 C* L! e$ T* y8 `- Q0 G- ?/ UIf the function succeeds, the return value is the system default language identifier.
* |/ E( Q, U7 @' F================================================================================
7 O/ M5 l" H: F3 GThe GetUserDefaultLangID function retrieves the user default language identifier.
3 a: ^8 E+ W! N* s* Q; f4 X8 v0 y1 J7 {, |' T0 s( b$ f1 j8 u$ x
LANGID GetUserDefaultLangID(VOID)7 f5 ]( L, {4 T) N+ h: S) m) R
1 o" O* C% F- Y" p6 U( E; a8 H
Parameters
' c' E. p- D' \7 a- ]This function has no parameters.
  l8 B' ]: i& l- n2 h! C- W& @Return Values( U3 x& Q, Y' O5 }% C
If the function succeeds, the return value is the user default language identifier.
$ I% P3 d; L9 D! e8 e4 ?================================================================================
$ `9 S9 h& L# `$ j+ |* p5 w
8 q2 z: y. m6 w4 oBOOL GetStringTypeA(
0 W2 n2 Q: C! u) L9 @- Q# f5 B# q* z+ t7 [& A  P
LCID Locale, // locale identifer
3 ]! a1 A8 e% n) s" r0 rDWORD dwInfoType, // information-type options ! |1 G; C+ s$ Q* O* b! G* j& t; ?7 S6 T3 n
LPCSTR lpSrcStr, // pointer to the source string 4 @: |9 X) b8 t0 [) J
int cchSrc, // size, in bytes, of the source string 1 m$ Q7 x8 l0 R: r1 b, M
LPWORD lpCharType // pointer to the buffer for output
' J  J2 P5 u( Z& m( `, p4 t, d);
& s- h( C0 o6 E$ qParameters6 A$ P% u  I$ D/ z! d
Locale
1 F0 p& D: I; a! lLOCALE_SYSTEM_DEFAULT Default system locale6 G1 [7 C2 s0 \5 i$ Y6 b
LOCALE_USER_DEFAULT Default user locale. q* e& F/ w1 B; c3 V8 m  a, X
dwInfoType
% J0 z6 a5 e% E1 f$ UCT_CTYPE1 Retrieve character type information.
/ M% |$ i/ t) jCT_CTYPE2 Retrieve bidirectional layout information.
) ?' x/ X/ {# @2 DCT_CTYPE3 Retrieve text processing information.
9 c) o+ x* i+ z: _6 K# }. F  slpSrcStr( R* g% ?1 q# r0 y5 t/ z+ t: x- |6 g
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.) x/ }- J+ R5 O
cchSrc$ J" C' s: O: }- V3 J
Specifies 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. 5 D/ |4 I6 f6 J2 L5 t
lpCharType2 |, u5 ]2 F/ v
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.
- t7 ^. B1 ?) N' f
" n- g- D9 x' pReturn Values8 m* }, C) t3 `! f1 j
If the function succeeds, the return value is nonzero.9 a9 M1 f! G9 R! a! v: e
=================================================================! E2 }; w3 z! y9 ~5 _) X
BOOL GetStringTypeW(
) \, D9 `- U+ n. W( F8 C' ~
; S- ?7 I( D3 d  yDWORD dwInfoType, // information-type options
& M! J6 l- ^7 S+ i& wLPCWSTR lpSrcStr, // address of source string / O8 Z  z5 g) ~; a1 ?
int cchSrc, // number of characters in string , r( y; b( G" e2 C; T1 Y
LPWORD lpCharType // address of buffer for output
3 o4 l5 c% q  P$ ~# Z1 O);
9 P/ @3 G6 Y3 t3 d& O==========================================================================
: B4 o+ o! z4 D3 r0 HThe GetSystemDefaultLangID function retrieves the system default language identifier. & y0 h5 x! f+ p) s- R/ ?* k
LANGID GetSystemDefaultLangID(VOID)* F+ G2 }$ i# i: r

5 m9 j' m; o, ^% p; k( \  _0 T# Z/ s; L1 N% _9 Z
Parameters5 J; j1 E6 Q" T- A# l' C) }! ~' ]
This function has no parameters.
( j( @5 ~- v5 A8 Z' J) ^8 R. z& a: H, y% b2 T& B. q
Return Values
0 X8 ~" F6 i. a: F' R( AIf the function succeeds, the return value is the system default language identifier.
2 v. b, Z8 W9 i2 U9 z' z  u! C; e- }7 \+ b4 K' T# \) {
Remarks1 e* |: t& x. _4 z* u4 E. O
For more information about language identifiers, see Language Identifiers and Locales./ [) J" N/ Q8 b- z" s* g! @
===============================================================================* @+ p# p# U6 Z& w! B; E7 J
int WideCharToMultiByte(
* e5 N% y& T& I4 o4 C  }; ?- Q: y4 a+ D- p
UINT CodePage, // code page % D0 g7 r! l+ y$ t7 j
DWORD dwFlags, // performance and mapping flags 3 t$ j$ ?$ S; R' x: p0 @% P
LPCWSTR lpWideCharStr, // address of wide-character string 8 V. |+ ?6 |9 H% P$ w, L, ?& ]7 m
int cchWideChar, // number of characters in string * C' M% t' k, Y7 l9 i: A" t: b
LPSTR lpMultiByteStr, // address of buffer for new string 2 X2 ?. \0 _$ J" l
int cchMultiByte, // size of buffer
! x; N+ n' G' `+ X1 i; [LPCSTR lpDefaultChar, // address of default for unmappable characters
. h2 d. ~. q- }4 U+ _" _( P, D5 cLPBOOL lpUsedDefaultChar // address of flag set when default char. used 7 s6 I' _( I0 N3 J
);
( }0 E, M2 k$ j5 V, t
% W" Q; P6 ]+ e3 v
/ y/ k3 A, s; _( ?Parameters' a( U  G  d& Q% D

; q) R. e7 J& i0 V3 @( CCodePage
' `, \$ a: H( G! U! f$ }; K. wSpecifies 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:
, J& Y; Y/ H, G$ B# V: {
9 @$ E/ h% `$ w; K' a7 R3 `Value Meaning" w8 x! m2 Y; X( f% \. P
CP_ACP ANSI code page
% `8 W/ [; g  w' `8 kCP_MACCP Macintosh code page
$ t1 ^+ [+ u9 K. E2 ^CP_OEMCP OEM code page( P' Q" c* `6 D$ B1 \8 a

5 X) s! ?. @' ddwFlags
6 c0 M' N- @# ~4 |( A5 x( b; eA 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:4 S# |" {: A+ r6 S

( p. t7 }( K! s) NValue Meaning
1 h5 T; A: p2 s1 ]; V; RWC_COMPOSITECHECK Convert composite characters to precomposed characters.
) I- k5 y8 C) x1 C. f. `1 s  e/ MWC_DISCARDNS Discard nonspacing characters during conversion.
( W# B3 {4 H& v. l) ]WC_SEPCHARS Generate separate characters during conversion. This is the default conversion behavior.7 m1 J( k- h' B' M$ ]
WC_DEFAULTCHAR Replace exceptions with the default character during conversion.0 q- ?7 e) e; H' a+ M4 }
7 h4 T& H4 \5 {- U: `9 Q
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
$ B# S% B  T" a" U" j" P, D5 P; |e is the base character, and the accent grave mark is the nonspacing character.
% E2 y/ n2 Z6 l) \( q
; j  D. [) n  {" E# }& vWhen 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.& `2 O! Z# d" M" H. m7 j
The functions default behavior is to generate separate characters (WC_SEPCHARS) for unmapped composite characters.# G9 ~9 @/ K6 k, @- o/ Y9 H, Y

1 L3 \5 B7 N! \& l9 @4 h& PlpWideCharStr0 L) k- J* g( ~6 a
Points to the wide-character string to be converted. 6 K$ c7 t- B9 d

  [: P, m$ E' m/ L" W8 |' H1 h8 jcchWideChar  l$ m# i& K6 Z- n; o  h+ y
Specifies 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. % y) @5 [& X; w3 h/ f. _/ \

( _- [% l8 {$ V4 t/ z5 z6 qlpMultiByteStr
- l7 k# l+ Y9 |8 X( a. ~0 cPoints to the buffer to receive the translated string.
8 v* h( J2 S* z6 |
7 a( N$ V6 X0 ~, [3 t' HcchMultiByte* x/ V6 H! ~2 B5 M  q2 a' A' E+ b
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.)
" X' l4 h% Z7 P$ ^6 ]7 N3 c* H% ~
) h* ~; m* B, E* DlpDefaultChar% M6 M% q& P0 @* v% |
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. 2 j4 X5 H% |) D

! P4 q7 R" f% Z9 ~4 R/ klpUsedDefaultChar
; s& i% {3 t/ z# `$ a1 g0 [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. : }! v$ c+ x3 e6 w/ I
8 J7 a5 D. N5 I, o2 I8 V

4 v1 E8 @0 V( Y
& o( u% \5 M2 W9 m) dReturn Values7 u) q0 c$ J9 A( {) J

: |. E7 h! ^; u) U( n% [2 i! `If the function succeeds, and cchMultiByte is nonzero, the return value is the number of bytes written to the buffer pointed to by lpMultiByteStr. % k5 [( W; W  {
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.
& R: ~% k( \7 Q' P( ~* J. R, rIf the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError may return one of the following error codes:
5 a3 C% Y. S8 A* {& l( \. H# i; V& C7 @( l
ERROR_INSUFFICIENT_BUFFER% D; s* y9 A  f8 ^/ M" g/ A
ERROR_INVALID_FLAGS
- ~8 G# ~- Q# W" 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日,是全球华人共同的冒险解谜类游戏家园。我们致力于提供各类冒险游戏资讯供大家学习交流。本站所有资源均不用于商业用途。

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