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

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

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

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

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

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

字体、语言相关的API函数原型:$ d! v! R' o0 ]) F: x' [" y$ k- P

. y1 H1 }  V' G# g' @. icreateFont 用指定的属性创建一种逻辑字体
! N. Z6 S/ N% d" B( xcreateFontIndirect 用指定的属性创建一种逻辑字体 7 b, g' c9 J( m4 p
GetStockObject 取得一个固有对象(笔、刷子、字体等)
2 S% }  s$ F- c7 B* P5 n9 M% G4 A  h' |9 L0 x
GetACP 检取ANSI系统代码页的标识符- W' ]6 g* H" U8 j  w9 Z
GetOEMCP 检取系统的OEM代码页标识符7 U; p/ r. U* t" G( h& X: K
GetTextExtentPoint 判断一个字串的大小(范围)(用于限制输入)
5 J0 M/ @# \0 D7 i) U5 }7 pEnumFontFamilies 列举指定设备可用的字体
! o, ]4 w* Z6 h% P* O% J  A7 V$ ]" S( uEnumFontFamiliesEx 列举指定设备可用的字体
: m: l0 t" z+ S, B- Y# |EnumFonts 列举指定设备可用的字体1 Y- l4 }" M3 Q- \
GetSystemDefaultLangID 取得系统的默认语言ID % i$ |6 S! c) M6 z4 [
GetUserDefaultLangID 为当前用户取得默认语言ID
* y0 ^9 U, J2 g3 M+ @  MGetStringTypeA 获取ANSI字符串类型 ,返回指定字符串的字符类型信息9 M5 Y& \4 b4 F* G( B4 `3 U9 C
GetStringTypeW 返回一个Unicode串的字符类型信息3 t$ B) f# _+ n! D1 V' U4 t0 i
GetSystemDefaultLangID 检取系统缺省语言标识符
1 S+ }, ~0 b0 h8 W4 B2 i6 B- cWideCharToMultiByte 把一个宽字符串映射为一个新字符串
+ I( r4 A/ W( J9 S; a8 w3 l
. M8 N) A! d% c=====================================================================. z/ o" v. S1 f9 {2 j% X5 O

- @2 u6 ]* |; f+ Y) r9 j5 B$ HHFONT CreateFont(
- ^8 O, h3 v  y+ I* D$ P
/ h" Z' H9 ]  A6 O, }$ ^1 wint nHeight, // logical height of font
, W* I& r+ ~* m& u) k. w! j5 Fint nWidth, // logical average character width
* h9 {  c6 u' \3 b, \+ Q# J, o# zint nEscapement, // angle of escapement
+ ~6 x3 x8 S# ~5 d7 n9 S4 M8 ?int nOrientation, // base-line orientation angle
: V8 C4 i7 d9 B: K% V$ sint fnWeight, // font weight - X7 P& ^1 m% R9 N6 t
DWORD fdwItalic, // italic attribute flag
# a! }, a1 ?; T, MDWORD fdwUnderline, // underline attribute flag
1 i' A- q$ h4 f0 r4 qDWORD fdwStrikeOut, // strikeout attribute flag   |- k7 z" K7 {5 ^
DWORD fdwCharSet, // character set identifier % q4 l" |" [+ R/ M. H6 g8 p; l1 u' b/ s( W
DWORD fdwOutputPrecision, // output precision
8 m8 s: Y6 g' e6 C+ X, CDWORD fdwClipPrecision, // clipping precision
6 ]3 o! e. s9 D3 j$ L  cDWORD fdwQuality, // output quality + w7 u! W7 l/ @9 d2 b
DWORD fdwPitchAndFamily, // pitch and family
5 s4 {# C) e& |/ p7 e$ O, [LPCTSTR lpszFace // pointer to typeface name string - M3 |3 F! o: o) O6 b
);
6 W0 o! _+ U/ y# {  o" d* [' L
* j+ g2 v9 V5 ~+ r+ e8 O==========================================================================) q& y7 {- R, |! X- E
HFONT CreateFontIndirect(' l+ ~* J3 H, a$ c* j

8 n0 I$ t1 L: W' ~3 B' I6 BCONST LOGFONT *lplf // pointer to logical font structure 8 X) K6 W9 L) u
);& @9 _" I4 ^! q& k  ]0 ^
& ]8 ?! ?; \# i
==========================================================================
- ~; I2 P6 z% @# `HGDIOBJ GetStockObject(
9 V. Y. |3 _! V5 h0 f2 j7 D% q$ K/ S- x/ G, G' p7 m
int fnObject // type of stock object % @, a3 U7 {5 _! C( t1 {5 U/ y0 A
);1 o: X" j# H- z
$ F$ J# i3 m9 b# b5 ]7 T
0 b; n% Y/ ~% {' `) Z/ Q/ x) G* y4 z
fnObject; e! y: k4 T. K8 s
Specifies the type of stock object. This parameter can be any one of the following values:
; R! ?* U6 K5 C1 T/ Z, e9 H0 w8 tValue
4 U* `0 X- a% ?: w, p2 O4.BLACK_BRUSH Black brush.& D! T% z) F/ u/ C- }3 n
3.DKGRAY_BRUSH Dark gray brush." M8 ?6 X, g. w0 K8 k2 H
2.GRAY_BRUSH Gray brush.
0 J- `% j- l4 U: n& o' S+ N5.HOLLOW_BRUSH Hollow brush (equivalent to NULL_BRUSH).; e3 h8 G) c0 Y, T: x
1.LTGRAY_BRUSH Light gray brush.
+ y# v* ~7 `  }" j+ q! F5.NULL_BRUSH Null brush (equivalent to HOLLOW_BRUSH).
2 U* h! J; A3 y0 n0 \) U0.WHITE_BRUSH White brush.
5 O- r' h" b3 g+ C% Z7.BLACK_PEN Black pen.
/ Q9 ?8 l" Y* D3 Y. k8.NULL_PEN Null pen.( `5 G- M1 ]4 ?
6.WHITE_PEN White pen.
. l2 Q" q9 c# N/ Y9 s" q11.(0B)ANSI_FIXED_FONT Windows fixed-pitch (monospace) system font.
. Y( f2 I8 G" S; e$ C12.(0C)ANSI_VAR_FONT Windows variable-pitch (proportional space) system font.
! b- d6 J: s" P6 P  Z14.(0E)DEVICE_DEFAULT_FONT Windows NT only: Device-dependent font.& c$ U1 A, V8 q0 M( U, Q
17.(11)DEFAULT_GUI_FONT Windows 95 only: Default font for user interface objects such as menus and dialog boxes.(一般选这种)
0 p3 J* C/ |+ S: w% W8 j+ j  O/ g10.(0A)OEM_FIXED_FONT Original equipment manufacturer (OEM) dependent fixed-pitch (monospace) font.3 K& D0 Q6 C7 @
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.
; ?5 ]1 c8 n6 G0 @: R16.(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.
' @4 M' y# {1 `6 j# L3 r, B4 u15.DEFAULT_PALETTE Default palette. This palette consists of the static colors in the system palette.3 X! R+ s. x9 }* t8 N' h1 ^
If the function succeeds, the return value identifies the logical object requested.+ K  B$ A) a2 n6 u' M! m1 ~2 ^
If the function fails, the return value is NULL. ; v1 Z4 C7 }  S- @
=================================================================================; l7 G: p! x4 M! x' ~' x' A
The GetACP function retrieves the current ANSI code-page identifier for the system.4 ^# d# K3 J3 _, y1 G  r7 S
UINT GetACP(VOID)
* a; v  H/ I$ q5 W2 `" n" i3 l1 a0 V; [! f2 Z
Parameters
8 D0 ?. S+ L4 N! |6 K$ YThis function has no parameters. / j' y# A, a2 y$ v4 T; ^
Return Values
5 A8 H6 v6 Q' wIf 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.+ l8 Z* E, b' R9 v2 @
Remarks0 W' }5 s8 M* ]; S4 s
Following are the ANSI code-page identifiers:
( ^; ]$ e8 P% v0 \2 Z" t8 QIdentifier Meaning3 g+ h: ?7 K4 b* N
874 Thai! O  a. c: d$ f5 G
932 Japan
* z3 t) [6 u: b" T5 X936 Chinese (PRC, Singapore)
% H5 @. J& y. y, E* ^5 T  V: W949 Korean; o1 c# P* E7 z! Y' z" [7 m$ d! V8 t
950 Chinese (Taiwan, Hong Kong) ! ^* `0 g5 h3 Y5 H6 S
1200 Unicode (BMP of ISO 10646)4 {8 L7 H. F5 @8 m- I1 K! N$ W
1250 Windows 3.1 Eastern European ! U  c. k" B* ~0 `7 D! J1 u4 S
1251 Windows 3.1 Cyrillic
5 r9 Z% ?$ E. B, J1252 Windows 3.1 Latin 1 (US, Western Europe)" B! U2 L* G" B+ s' \5 {
1253 Windows 3.1 Greek( Q5 i0 w6 w+ `; o
1254 Windows 3.1 Turkish
' T$ ]& M+ c8 O! ]1 G% h" n1 B- O9 b* S1255 Hebrew& L0 V; G/ z) b% _, }% {5 Q) B
1256 Arabic
1 z9 D- @8 q  Q# X6 P( m( Q. O1257 Baltic
. F, |* k! M9 {7 A& ?=============================================================================
6 F* }1 D4 s# M# X, u' O8 Y6 vThe GetOEMCP function retrieves the current OEM code-page identifier for the system. (OEM stands for original equipment manufacturer.)
" ~5 k) A# Y, v6 ]: O9 \: |7 P- C& M, M  b  X3 k
UINT GetOEMCP(VOID)
) y3 g( e2 F1 G- z0 z
  C; P' r- @. x: s' S, H8 O1 [+ f: J7 j& [" W( `8 F
Parameters9 A) C. [) U/ q; V

# F- S, w0 c) J3 i( m, IThis function has no parameters.
: W4 `! v. K, V$ j, ]4 U
( p0 }1 T0 l- u0 dReturn Values8 |0 _1 n7 P, C% b2 X/ X: v7 H
( D4 b9 c3 }" Q3 _" P7 U0 S. V
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.
' I# W) x! u) F) R. C2 k5 B2 n
$ `3 n9 V- _" u* F; [Remarks% Q, ^5 z- H% Y! d& `

. J  H7 [8 r( @. t9 W/ \9 z2 r' mFollowing are the OEM code-page identifiers: 6 [6 b. C, {4 d+ v& L% @9 C9 v- e

# t, c! f0 c8 B. Q" G" s. L6 YIdentifier Meaning
/ a& ^3 J: ]) v+ E6 V: _0 B437 MS-DOS United States
' x  X  `+ `1 Y! l: h. y( P708 Arabic (ASMO 708)
5 x5 w7 b  Q$ {- c. P7 W6 F! S9 ?709 Arabic (ASMO 449+, BCON V4)
2 {. {8 U+ M* z& v1 X0 ~* X710 Arabic (Transparent Arabic)
; f5 C6 l( Q: S4 n: o7 k! a. |720 Arabic (Transparent ASMO)
& d3 f" [* O- u1 d2 q737 Greek (formerly 437G)
3 n7 c: I9 \( R0 \0 N775 Baltic/ x0 ?2 w  I$ f+ A; Y, G$ i
850 MS-DOS Multilingual (Latin I)
& F0 [' {3 c/ V6 a: V& g852 MS-DOS Slavic (Latin II)
& r' C1 \9 w6 z( g8 a7 V855 IBM Cyrillic (primarily Russian)! D/ G" b# o. z; _
857 IBM Turkish, F# j. q7 U+ o' @$ G$ l' M* F' Y
860 MS-DOS Portuguese( G8 J% Y/ Z5 S/ b+ f3 L. a
861 MS-DOS Icelandic
9 a4 u5 X7 Q9 e7 I) q$ D: B862 Hebrew
' s5 ?9 B8 O! \6 |$ A8 t863 MS-DOS Canadian-French5 l% e* d/ _4 i4 w
864 Arabic2 [+ k4 o% S. P( I9 d2 [' ~0 N
865 MS-DOS Nordic
; \$ A7 F* ?4 e) k3 a( E9 r  n866 MS-DOS Russian (former USSR)
8 V. }: u) ?4 r0 Q$ ?7 U8 o# z5 G869 IBM Modern Greek& ~' r4 V6 W/ f
874 Thai5 f  S% W  {3 i3 N% V: x* l; b
932 Japan
% s* Y: q1 W6 G* q2 D  ?% S+ H" X9 K936 Chinese (PRC, Singapore)- Z# K) _' S  |! k: ~# ~9 ^
949 Korean
. q$ r8 j; c6 K0 u: q950 Chinese (Taiwan, Hong Kong) . p1 B- w  z$ e3 A: s. `# E8 S* Q
1361 Korean (Johab)
% G4 J  s+ Y$ ^===============================================================================
: m; ^: J; g% }" ~8 |' R4 IBOOL GetTextExtentPoint(2 z) X6 |2 b! d; O2 D3 \

( K* `0 Z, E; t% U4 QHDC hdc, // handle of device context
$ L' P# H/ w( q$ |' K& |LPCTSTR lpString, // address of text string 4 h0 E6 `5 G% y
int cbString, // number of characters in string 3 }3 L6 p# c& d) p
LPSIZE lpSize // address of structure for string size
3 D- t9 O+ j; O1 S);
9 _( i& _) n4 [, A===============================================================================; D- Y/ G. D: w' t4 r: ?
The EnumFontFamilies function enumerates the fonts in a specified font family that are available on a specified device. This function supersedes the EnumFonts function.
( O, t+ L0 l1 T) j* E+ Bint EnumFontFamilies(
4 b& y2 M) C5 E- Q+ ]+ c4 LHDC hdc, // handle to device control
% K8 e& T/ ~+ l0 {& M4 W6 u0 F* jLPCTSTR lpszFamily, // pointer to family-name string 7 _( F4 ~3 D6 e6 z9 y! _4 V* \8 j/ f
FONTENUMPROC lpEnumFontFamProc, // pointer to callback function 5 p, ~1 d* p+ p" q
LPARAM lParam // address of application-supplied data
+ w' Z' h: m0 V: g8 ]% `);
1 m# S" s) U2 E" o: J4 J7 I" Q% I# g& p
Parameters
) e" k9 @) h* `' \9 `) o5 z) `+ shdc6 p4 n( p! E3 W* M5 r& c
Identifies the device context. 5 b9 t; q1 w8 f2 u" Y$ N+ V
lpszFamily
3 }# {( Z( H3 ?5 t4 ]8 Y* [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.
& u2 N4 B  N/ V7 r& Q0 nlpEnumFontFamProc
6 E! g2 [5 h/ y5 p2 i4 W# O; b0 ?Specifies the procedure-instance address of the application-defined callback function. For information about the callback function, see the EnumFontFamProc function. 3 P( k! o: ^: e' `/ R
lParam
9 f( l$ z# {' @, o) CPoints to application-supplied data. The data is passed to the callback function along with the font information.
' C( h, C$ j7 D$ c- {% U
; H4 z. B, N3 r; e- h  I$ eReturn Values1 S+ J: h5 ~1 ^6 x  x( g
If the function succeeds, the return value is the last value returned by the callback function. Its meaning is implementation specific. , r2 v0 q0 o, D: N
=============================================================================, F" s- @( o2 p9 r& I
The EnumFontFamiliesEx function enumerates all fonts in the system that match the font characteristics specified by the
: u- q' a; Z6 X3 u/ _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.3 K3 O) R9 n& \- A# |: w! t
2 M) K; |$ E9 y
int EnumFontFamiliesEx(
, H$ `  A5 W$ X3 V" R( Y7 {HDC hdc, // handle to device context4 k: b: N: a2 j) M% D% l0 c- }
LPLOGFONT lpLogfont, // pointer to logical font information! |) P& r, X  {- f6 V
FONTENUMPROC lpEnumFontFamExProc, // pointer to callback function
5 @# [1 B. Q9 O0 B$ h- t( ELPARAM lParam, // application-supplied data
  T4 ~" g( d) S: R% NDWORD dwFlags // reserved; must be zero
" |# j; m2 q& g) I& ~. n- G5 W; P);
7 _4 Z4 m. Q0 Q  m* [2 v3 V=================================================================================* U2 @' K+ {( \$ W
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.
, ], D+ n5 h& [0 x+ UThis function is provided for compatibility with earlier versions of Microsoft Windows. Win32-based applications should use the EnumFontFamilies function.
. k  B- ]7 M6 s! {$ r" s% p* d6 P* T
int EnumFonts(+ C5 K" p9 y7 b: @1 p
HDC hdc, // handle to device context $ Y% [: F( v0 C1 p& T- C8 B& W
LPCTSTR lpFaceName, // pointer to font typeface name string % R! v. }+ J1 B2 Q+ V
FONTENUMPROC lpFontFunc, // pointer to callback function & [, }: [8 }9 ^6 V8 |. j, k; Q
LPARAM lParam // address of application-supplied data * J! d4 ]$ z6 X+ x& q- T2 y
); * w# L- @! }- o! B* l  J
, n$ m1 g: B7 I* T
Parameters
5 W5 }; r" K$ P- a1 ]  n- u( phdc
) ?/ q, r# \/ A' I2 lIdentifies the device context.
& l  b$ [9 Q8 n6 C4 l1 ElpFaceName
, s2 y" g  I/ U4 I' A/ S4 xPoints 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. # M% K% F7 t$ V, t5 E
lpFontFunc5 D% ?6 f; [* K
Points to the application-defined callback function. For more information about the callback function, see the EnumFontsProc function. - G2 R( i; Y4 E1 ~
lParam
0 _8 \0 i' s0 ~- C1 Q$ QPoints to any application-defined data. The data is passed to the callback function along with the font information. 4 {% L: a% y9 w
8 a6 e5 Z; i; ^! [" m: N$ t
* ~. I, a  U1 ?( U( ]& l
Return Values6 k) ~: I) T# f/ ]) @  R
If the function succeeds, the return value is the last value returned by the callback function. Its meaning is defined by the application.
# p4 b0 D: K) }# X4 f! G$ H3 b5 f======================================================================
$ c, z1 {9 z5 @# ~( B/ j/ eThe GetSystemDefaultLangID function retrieves the system default language identifier.
1 {: N7 Y0 Z9 F& X. h! G
+ j; N8 H' e4 s9 l( p  rLANGID GetSystemDefaultLangID(VOID), T+ ?3 B8 J: S4 ?2 @$ v2 u
7 Q( K* `! H9 H" r6 E+ r
Parameters
* e! x% m8 V3 l' p+ U4 X) [  y( X' JThis function has no parameters. 9 }; ?; }5 |! p! t+ X* A' O* [
Return Values2 {1 F& t2 n: U: j6 t$ O
If the function succeeds, the return value is the system default language identifier.9 M* h6 Q3 s6 ~' e; V; F& L
================================================================================% _* U) n* D4 b. I9 w/ z
The GetUserDefaultLangID function retrieves the user default language identifier. 0 ?; E( S/ `1 Q1 l: S2 K
' r  o# x! U) y1 ~6 b2 I
LANGID GetUserDefaultLangID(VOID)
  |2 ?- h5 w. N! v: j( b4 p
. H; C: U& J. r7 G) i/ tParameters' O( f; Z& V: E2 h+ a* }
This function has no parameters. ! P6 y; p1 f6 L+ G
Return Values& z: [! a' Y. f, r
If the function succeeds, the return value is the user default language identifier.
" n7 s4 g6 p( ?* j================================================================================
; X6 q  L/ F3 ?+ m$ G5 J0 x% {- G! C( s' x- B& a
BOOL GetStringTypeA(9 h) s* F2 l$ d" @/ m, g8 P5 s3 F
+ l3 }: C4 q/ @7 F" |0 X6 @6 j
LCID Locale, // locale identifer2 V5 R9 O' F# J/ j: H, K' t1 K# D7 B
DWORD dwInfoType, // information-type options % A& C7 M1 p4 x" W
LPCSTR lpSrcStr, // pointer to the source string : H8 k6 o( E! s
int cchSrc, // size, in bytes, of the source string
# _6 o: s# W5 g2 f, kLPWORD lpCharType // pointer to the buffer for output
' @4 ~( E+ k) X);) P5 M" R, B4 E  V
Parameters+ o- f6 ?4 l! T
Locale$ }/ d/ g# \: o6 a" }
LOCALE_SYSTEM_DEFAULT Default system locale
  I; |0 L. g# H! X8 S/ B/ l* OLOCALE_USER_DEFAULT Default user locale) l1 ?0 g2 b5 I" U- \& o, b" L! _
dwInfoType
! g; m& Q! v; w, ]CT_CTYPE1 Retrieve character type information.) h' S! q/ [& P: _2 O% ?
CT_CTYPE2 Retrieve bidirectional layout information.$ Z3 H% t  p5 d8 M; s1 s
CT_CTYPE3 Retrieve text processing information.0 f7 S1 P+ m# ^# B) ~. k
lpSrcStr, {3 o! u3 z7 {& [
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 W, n" A3 F$ n5 I( h& t( VcchSrc7 c! L$ h0 C2 P* \6 n9 [$ X0 M" L
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. # w, K+ L; c# p8 E2 V, Z
lpCharType
/ V/ e2 p  X1 ?( e6 i3 [4 p' D9 {& ~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.
  z1 b4 j4 Y) T2 o, x) r6 s! N4 @; A7 m  `1 U! c2 k/ F
Return Values
+ N3 X8 N/ Q! C% f! T' ^If the function succeeds, the return value is nonzero.3 g* B. A$ L0 R6 S8 y( z
=================================================================
5 R- x2 u" c8 l1 y4 @$ |* b3 R6 uBOOL GetStringTypeW(7 U0 J( h. Q9 e  m2 f  g

* S& c, I( c' J, u! Y' ?DWORD dwInfoType, // information-type options $ b7 q0 Z. ]* Q% _5 i
LPCWSTR lpSrcStr, // address of source string # H  V4 n, s4 J4 Z
int cchSrc, // number of characters in string 8 J7 C; n" j; x# O# D# V
LPWORD lpCharType // address of buffer for output
+ U0 w& n- K) A& x$ O9 H);: M/ f. L% o0 E" V9 k' T) M  y
==========================================================================2 \8 S+ c9 D1 N( J  w6 E
The GetSystemDefaultLangID function retrieves the system default language identifier.
. l3 z2 l9 W6 I4 S4 MLANGID GetSystemDefaultLangID(VOID)
: n; D  J; i# ?3 }" q) J- x: `; l+ T; K6 S- A" [

5 \+ H# S  ~! Z% h* pParameters! p3 Z/ l4 B- ~) T
This function has no parameters.
, L- ~5 G- d  q! s2 F0 k% M& u" w9 s
- M: ?4 E! s: V4 v& V; V) [( EReturn Values
: D; ~" z4 Q- F- q0 e( G( \  g" tIf the function succeeds, the return value is the system default language identifier.
8 F5 A( `1 n# c7 O: |' X9 o$ x8 l- d6 e2 |" p9 A# x+ O7 h1 `
Remarks, Z1 i1 q) R$ ?
For more information about language identifiers, see Language Identifiers and Locales.
# }& j' L0 b  o) G' D===============================================================================
5 d) l/ U: x7 S8 Uint WideCharToMultiByte(
/ c# d) n( d) |  J6 D' T( k  ?! S% `7 z  k/ \- V
UINT CodePage, // code page
) F) d/ g5 V2 W: O5 a. c: `, ?DWORD dwFlags, // performance and mapping flags + Y* ~  E- \6 e& K; S% ~6 z6 Z
LPCWSTR lpWideCharStr, // address of wide-character string 0 v+ l2 _3 ]* O# \5 V
int cchWideChar, // number of characters in string 0 _% y9 Z8 a# U0 T) a
LPSTR lpMultiByteStr, // address of buffer for new string
0 c$ N: F: }( \% y) U3 J1 zint cchMultiByte, // size of buffer 6 V, \4 Z0 |9 F) x
LPCSTR lpDefaultChar, // address of default for unmappable characters 1 ~. O$ o& F/ f5 ~: r8 C
LPBOOL lpUsedDefaultChar // address of flag set when default char. used
6 _8 C5 B& V( u8 \); , l! n: y( F3 |+ M2 {
6 F) I4 G. {+ Y1 M3 e
& W0 t0 S/ h" _5 y* O, F
Parameters
( F! M8 O5 U, Y: M- f
& _0 e6 {' l$ P# YCodePage
5 z8 ^2 w4 T( @, K3 Z% e* u1 G: {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: + R: Z& `3 ^% l: p. t. C

- c7 d8 D7 k& u6 r- iValue Meaning+ x. J! c& `, `. p4 K8 X
CP_ACP ANSI code page
" X# z( B* k8 g6 dCP_MACCP Macintosh code page
4 {8 E" _9 b2 |+ T9 ?, y/ t* yCP_OEMCP OEM code page8 g! X" c4 r) O9 S' ^
1 I( \) H$ \0 j$ i5 m
dwFlags/ u* C# P/ D1 }! w! l7 x
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:
6 _2 }* h3 o1 u8 I; ^9 ~6 A4 N; L
: E" |7 I, W4 R( V( g" n( eValue Meaning
6 R1 Q# k" |1 ]2 VWC_COMPOSITECHECK Convert composite characters to precomposed characters.6 {3 u8 k5 y2 Y) R+ P: y' s
WC_DISCARDNS Discard nonspacing characters during conversion.3 [& M6 M- h4 J* u% R  [# p: G" `
WC_SEPCHARS Generate separate characters during conversion. This is the default conversion behavior.
- U- T9 S' E( R/ FWC_DEFAULTCHAR Replace exceptions with the default character during conversion." B2 x! r3 r- a9 b4 Z1 ^$ ^* N' K

+ D8 D! E/ o: R) S" [' P) mWhen 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 8 n( D7 T! ?- v* k, @) Y
e is the base character, and the accent grave mark is the nonspacing character.3 V$ x2 G5 a  r  d) [
- d! I6 O* }, ?
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.
% f1 \+ X: n; q- vThe functions default behavior is to generate separate characters (WC_SEPCHARS) for unmapped composite characters.
' `4 i5 C% b) b
- h, Z) e% q( Y$ m  t, HlpWideCharStr
6 I" r# f" e, p) r2 N1 B( WPoints to the wide-character string to be converted.
9 X/ a# M$ `- O, K% @
/ `( Q& D" x% s, CcchWideChar3 u7 ]$ K0 W& f8 X( H& M
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.
7 @9 k- ?! |+ K# w- Q' p" n; F* h1 i+ g
lpMultiByteStr3 W4 s, @2 J9 Z* b# v; r
Points to the buffer to receive the translated string. / G% R) v8 G, l# b( ~) c# M) r# F! Q
3 k6 A- J+ x3 h) a7 N  h6 V1 }6 Q
cchMultiByte4 n* e: {: u: [
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.) ' R6 ~& U9 d% e
# o0 }7 c+ |; k6 {; L) f6 S+ I. z, A5 t
lpDefaultChar
; P: c, p$ E  v0 ]# V4 K& i- hPoints 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. 3 U! ^. n8 w) e! B
% K+ s# y1 g  _' e
lpUsedDefaultChar
8 l9 X; Q- z) x9 o1 Z$ n  [4 [3 N8 APoints 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. 7 N4 P* j& F: {6 Q& j$ j

; p1 z; E; K+ @( \; H5 E+ F, |. f4 G" x2 f+ m/ b! B

! X$ U$ W6 |: r0 J  NReturn Values
: b/ O6 [  r- T' S* j, a; ^9 R1 o( E) ^( D( ~: ~8 a
If the function succeeds, and cchMultiByte is nonzero, the return value is the number of bytes written to the buffer pointed to by lpMultiByteStr. : t) F/ x. u; r) N
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.
$ s- N1 ?* w: }2 gIf the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError may return one of the following error codes:
% K- [' P5 U* l: L* X% z( i0 g8 O7 A- A  X. c1 n
ERROR_INSUFFICIENT_BUFFER/ w+ t- n5 F% d& L1 g
ERROR_INVALID_FLAGS
3 o7 o9 `* c' w1 b0 v$ DERROR_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日,是全球华人共同的冒险解谜类游戏家园。我们致力于提供各类冒险游戏资讯供大家学习交流。本站所有资源均不用于商业用途。

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