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

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

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

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

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

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

字体、语言相关的API函数原型:
0 u& E( X" @  m* G3 [
" l) H% Q/ T$ IcreateFont 用指定的属性创建一种逻辑字体 . J; w5 h1 i1 p
createFontIndirect 用指定的属性创建一种逻辑字体
8 o9 t) W& a( T2 k( R* fGetStockObject 取得一个固有对象(笔、刷子、字体等)
& I0 _7 B+ e4 j( z: C' i5 w7 |( c, A- \7 o0 ]+ ?& g4 O
GetACP 检取ANSI系统代码页的标识符2 E' s. q& u8 O8 ?# t( S
GetOEMCP 检取系统的OEM代码页标识符  n4 ?: @5 W: q" V
GetTextExtentPoint 判断一个字串的大小(范围)(用于限制输入)
/ T6 B; b9 a/ j/ A1 w* zEnumFontFamilies 列举指定设备可用的字体- H& I. ], t6 N  s* R/ D6 N
EnumFontFamiliesEx 列举指定设备可用的字体 ; D' a3 c9 T% F) B5 {
EnumFonts 列举指定设备可用的字体+ ~" `* ]& f: N% B% x
GetSystemDefaultLangID 取得系统的默认语言ID 3 a+ o+ E( A; u5 @! i! _
GetUserDefaultLangID 为当前用户取得默认语言ID
7 k% A0 ^# g  Y% V9 @1 v5 kGetStringTypeA 获取ANSI字符串类型 ,返回指定字符串的字符类型信息2 r1 g% }6 T( e
GetStringTypeW 返回一个Unicode串的字符类型信息
) j% J) @, A/ _9 s) Z: vGetSystemDefaultLangID 检取系统缺省语言标识符8 Q  k5 G% V( j* T# B2 c
WideCharToMultiByte 把一个宽字符串映射为一个新字符串  z7 C- L' n5 _; _/ m/ P/ _
* ^1 H1 k+ [5 H, u. t8 K
=====================================================================
  B# z) V: o0 G6 Z* s
  K2 g& [8 z8 N4 `2 i6 IHFONT CreateFont(
, V- M% D. d0 w3 N  ], x$ r: N3 b
/ S% y6 Y" t& y2 F* Iint nHeight, // logical height of font
- L% V( l7 G9 c) s% X7 B3 Mint nWidth, // logical average character width
. x8 X2 r$ s0 N  z0 cint nEscapement, // angle of escapement
( R  d+ n* s# L; x& Aint nOrientation, // base-line orientation angle 6 ]3 q( `6 d, Z$ j! @
int fnWeight, // font weight & D' |8 M. R1 k% Z
DWORD fdwItalic, // italic attribute flag
3 j; E9 }( ?2 F3 DDWORD fdwUnderline, // underline attribute flag / {" ]5 Y" W6 d1 I/ T; q4 a! ]
DWORD fdwStrikeOut, // strikeout attribute flag # n9 W. B. \3 S- N. b6 }" _- H: D
DWORD fdwCharSet, // character set identifier
) @8 P" W" G% f2 j( \DWORD fdwOutputPrecision, // output precision ! U9 F  l% R6 D0 a4 V7 u2 V2 j# l! }
DWORD fdwClipPrecision, // clipping precision   {" h& l  w  X% _
DWORD fdwQuality, // output quality 3 M% V7 J' N, s; e9 ?
DWORD fdwPitchAndFamily, // pitch and family 2 p4 f/ |7 ^& ]$ W7 f: o1 }: \; ~. E
LPCTSTR lpszFace // pointer to typeface name string ! K5 A9 ?) E3 o! j* F7 ^
);
  H+ m0 w$ V- Z' }
  E9 O! B5 c/ d5 E! W' N' _3 P5 ^==========================================================================
  z( x. S9 g. O/ S! nHFONT CreateFontIndirect(+ r1 @; [! y8 B8 v* k; M% ]

3 v' o. d8 Y- Z& W1 f. {9 UCONST LOGFONT *lplf // pointer to logical font structure ( k7 p1 s) M* i) Z4 u
);8 N; O- E$ f5 A$ d1 Z6 M
1 O. _$ ^# [, g: j/ P
==========================================================================( e: ^. @4 b' B7 F9 ~! k
HGDIOBJ GetStockObject(
% `' y( |" w5 G/ [7 A& Y: @4 i. j% i. @. `; z4 ^8 g& z7 m6 C' P
int fnObject // type of stock object 8 D9 J* p, X0 k/ o
);
( H' Q% N" d2 `. \- A1 Z2 q0 j' y7 B
0 X5 o) q8 o3 i% [2 O+ ?4 Z4 S
fnObject% Z+ @5 B) t0 S; d5 e, f: ]  W
Specifies the type of stock object. This parameter can be any one of the following values: ) \0 O; u0 F# _- A8 d5 ]
Value
4 i* n* F3 @. Y# @. s4.BLACK_BRUSH Black brush.3 q: ]8 `& L7 n8 [
3.DKGRAY_BRUSH Dark gray brush.3 V- @: Y+ k% e# @' z4 u+ S
2.GRAY_BRUSH Gray brush.
) \' D/ G* h! ?% l  Q, F8 I1 |5.HOLLOW_BRUSH Hollow brush (equivalent to NULL_BRUSH).& S4 D( l- R3 W+ x0 G- s2 I
1.LTGRAY_BRUSH Light gray brush., M9 D4 A7 ~+ b; ]6 |
5.NULL_BRUSH Null brush (equivalent to HOLLOW_BRUSH).
; s8 a3 \& [) j# P0.WHITE_BRUSH White brush.
: R7 w3 h3 \0 I8 A) i4 `7 N7.BLACK_PEN Black pen.
+ L$ g/ {: U( x2 V8.NULL_PEN Null pen.$ r) l7 M4 `, \" R  b
6.WHITE_PEN White pen.8 G& @5 O6 y3 H( _* w3 W* E/ d
11.(0B)ANSI_FIXED_FONT Windows fixed-pitch (monospace) system font.. u0 w$ h/ a* \% t+ f! B. w0 t3 b6 ^
12.(0C)ANSI_VAR_FONT Windows variable-pitch (proportional space) system font.
2 }  I4 U) \3 g14.(0E)DEVICE_DEFAULT_FONT Windows NT only: Device-dependent font.; _6 D/ W% v& |- T
17.(11)DEFAULT_GUI_FONT Windows 95 only: Default font for user interface objects such as menus and dialog boxes.(一般选这种)
1 h7 S) b& `8 b2 n; H; B' x10.(0A)OEM_FIXED_FONT Original equipment manufacturer (OEM) dependent fixed-pitch (monospace) font." n. J& r$ L: R$ s) i3 \1 g* h
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.
$ R8 O$ w- E: q6 o) V16.(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 S% ~0 E) u9 B9 [& j
15.DEFAULT_PALETTE Default palette. This palette consists of the static colors in the system palette.
. ?9 a3 u0 O5 \2 _* {( u& P: L. ~) mIf the function succeeds, the return value identifies the logical object requested.
3 P2 @  n0 J9 ^% W( w2 ?If the function fails, the return value is NULL.
- B; e3 [4 u9 q; x=================================================================================
6 m) h8 Z1 `# ]8 C% X% VThe GetACP function retrieves the current ANSI code-page identifier for the system.
- M& U0 d' l+ f- A! M" B( CUINT GetACP(VOID)
9 Y6 E4 W2 p( Z- A; y& W0 @
0 @7 S( b, i  D  P& Q" |  s$ JParameters
! }3 m$ O  B& Q4 L2 h% A% jThis function has no parameters. / B' R' [$ `. @) j  P/ }4 Q; e6 @  i
Return Values
1 J: K3 E% A. F: h( ~+ y. BIf 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.
4 f4 K5 X) i7 m. C% rRemarks6 {. ^$ [% s& L( `9 I% U( z
Following are the ANSI code-page identifiers:
! ~5 c8 g# i- K% x" \) M: I9 ?Identifier Meaning
2 W1 ~4 J% a2 J6 D+ x' {874 Thai
3 T1 ^  |3 p- F5 G6 c! |- J: }932 Japan
3 ~- }2 l% n( [936 Chinese (PRC, Singapore)+ \% f6 t# {8 H- q/ Y- f' Q; q
949 Korean
7 |8 V5 a  e1 _950 Chinese (Taiwan, Hong Kong) / B- H/ j3 m: V& s7 U
1200 Unicode (BMP of ISO 10646)/ c. h- F( a! @% _" }, W/ T
1250 Windows 3.1 Eastern European * N5 ~4 ~$ P% t0 y4 c
1251 Windows 3.1 Cyrillic7 @+ j1 x7 ?2 j# T  Z4 ^$ ~
1252 Windows 3.1 Latin 1 (US, Western Europe)3 V1 h% l& H7 s
1253 Windows 3.1 Greek  ^+ |3 }4 \! q' g7 l. o3 j. ]1 j
1254 Windows 3.1 Turkish( H6 j  }( T6 {. y& J: _
1255 Hebrew
# O: s& l* `3 s8 I4 [5 P, K1256 Arabic( v0 b$ G/ O6 Z4 g4 ~6 d0 a
1257 Baltic
( y: x  [# K  `* `7 u=============================================================================( r, U0 D! I$ O4 \6 B2 H* E' ~
The GetOEMCP function retrieves the current OEM code-page identifier for the system. (OEM stands for original equipment manufacturer.)
5 }- l9 X; W& n0 p; f+ `
+ T6 @, r* D8 ^* ^, v( M9 SUINT GetOEMCP(VOID)8 ?5 X7 W, m  a6 w" o+ \8 t2 P2 M0 V
' w3 p, a2 [2 U2 {  Z

; D" t+ q  @5 y7 XParameters
( c8 A2 A3 g' I9 t- {2 m% O
+ J' u+ W, C, h$ M' D! EThis function has no parameters. 2 X. ~8 A/ T( g& I: \# Y1 b

* ^' D7 \, F- N0 f  M: \" qReturn Values
; c  @. I' V' D2 }# T4 s; X5 z' ?
% c7 f4 |1 v& DIf 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% q0 O( a7 f' P$ O  z: e' I: z! T, B$ y* D: O: ^6 I* g) H
Remarks
" x: i; e5 ^% w
' s0 G) a' _: @2 R3 ?4 {Following are the OEM code-page identifiers: 9 a& y6 U  ]4 d+ p. K: K  f9 |
4 r* K6 H! E" F7 v, D
Identifier Meaning" y" z$ @' r% y$ ^( ]
437 MS-DOS United States
' l) r# ~" M. q4 `$ e708 Arabic (ASMO 708)
0 j  ?* S! |7 ?7 P1 p709 Arabic (ASMO 449+, BCON V4)
3 N; {  c* \7 W% C# P710 Arabic (Transparent Arabic)
' d# S% x% _) R7 ?+ Q9 n0 ~4 G4 D720 Arabic (Transparent ASMO)
7 ?/ @" k  j; P/ w. U( R737 Greek (formerly 437G)
! }2 ]- `! t  _& B775 Baltic
  _) C, U+ P6 V3 H/ S0 y850 MS-DOS Multilingual (Latin I)' l; U( c% l4 Q: H& V& ]' j7 h
852 MS-DOS Slavic (Latin II)6 }  o5 [/ ~6 E$ A3 C% {3 E# T
855 IBM Cyrillic (primarily Russian)" q# S" j, t7 m
857 IBM Turkish
1 z$ O+ r$ [) o, j0 l# P9 B860 MS-DOS Portuguese3 J3 c# J5 f' `
861 MS-DOS Icelandic
, r- u1 y- G3 R5 p! L$ R/ \862 Hebrew
, I6 d6 h1 k/ X5 U; j3 p: D/ m9 y863 MS-DOS Canadian-French
3 F: X0 b% X$ K+ x/ U9 }864 Arabic3 W' g! f; l! f% N4 u  \+ U- G( _5 @% w
865 MS-DOS Nordic
  `5 k0 O- N9 t% ~866 MS-DOS Russian (former USSR)( I; p- [* S2 Q  ?+ o( |1 o- d
869 IBM Modern Greek
! H* D# `3 i6 Y" D+ j+ G# K874 Thai
: b- k3 y* p, q1 Z! f5 i932 Japan
$ `# I" W: f/ Y/ E: X; C- ?* f936 Chinese (PRC, Singapore)
7 \$ s' l' _, L. u- r, }& k  f949 Korean
; _0 G$ u+ J2 j( ?1 t950 Chinese (Taiwan, Hong Kong)
4 ^' k; \5 P. G5 N- z3 ~2 J! j1361 Korean (Johab)% }' A9 _6 e0 W; F  l* L5 b
===============================================================================
* a, Q2 o. g5 f1 PBOOL GetTextExtentPoint(
/ W" i- C6 P% [2 V3 m0 {5 i
( a: A- R$ ]$ F9 J- THDC hdc, // handle of device context 0 I! |, `5 H/ m9 v* K/ x1 w
LPCTSTR lpString, // address of text string ( s7 i; G7 ^4 a
int cbString, // number of characters in string . @0 S# K6 P* n
LPSIZE lpSize // address of structure for string size 5 F2 `# i6 b0 |: y  U$ O, ^; w7 A# r
);
3 b7 {% S' O5 V2 ?" A: C0 s+ V===============================================================================
9 j- v" @/ g# `$ o- _7 YThe EnumFontFamilies function enumerates the fonts in a specified font family that are available on a specified device. This function supersedes the EnumFonts function. 7 P0 ^7 I* x  P, B
int EnumFontFamilies(/ Y. @3 w" e7 X5 q. Y
HDC hdc, // handle to device control : ~8 F/ l* S- L
LPCTSTR lpszFamily, // pointer to family-name string
0 y6 }/ r$ f2 m- r* |2 kFONTENUMPROC lpEnumFontFamProc, // pointer to callback function
* o1 q3 [' |; L; t" x$ P5 C/ i6 }LPARAM lParam // address of application-supplied data ' D9 S* S5 o* K7 g; G2 V8 |
);" b- A& Z. g, ~' ~, H4 f( X

% w, t( r" J& w8 CParameters
3 U7 k9 L7 s9 P# \* ?/ H: v- Dhdc; U! V3 M' N: E8 I2 p, ~# W: |: A* R
Identifies the device context. & F  J' |& O- a
lpszFamily
, E4 b' |# h* k7 H* z4 N5 qPoints 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.
  E6 h! f" ^) o  X. l, k# HlpEnumFontFamProc
) f8 R! P' h9 G  D9 ]5 SSpecifies the procedure-instance address of the application-defined callback function. For information about the callback function, see the EnumFontFamProc function. , M. |4 ]- l7 B; Z7 e7 ?
lParam* d$ L8 U: c- z8 c0 I* N
Points to application-supplied data. The data is passed to the callback function along with the font information.
. S9 Y# E; o6 E  X
( S0 f' \1 G! ?( R- f2 fReturn Values
% S* V; x4 f- b, R+ Z% S4 j9 x& RIf the function succeeds, the return value is the last value returned by the callback function. Its meaning is implementation specific.
4 x) ^6 w1 K7 f2 A- \3 P. T=============================================================================
4 x3 M* m3 _7 A9 b: T( p$ u: c/ SThe EnumFontFamiliesEx function enumerates all fonts in the system that match the font characteristics specified by the ! ~- ^7 S  l! h7 t& W5 v" Z- H
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.  y# X" O& {; Z/ A* r! L: U
0 B9 I( K. D) O* z- C
int EnumFontFamiliesEx(
+ j; T$ Q( Q0 }+ W! v4 S% |% Q. NHDC hdc, // handle to device context, _: O. w& m' D' t; P$ U5 `6 {6 k
LPLOGFONT lpLogfont, // pointer to logical font information! M, o( ?' ?" I1 @& m; i
FONTENUMPROC lpEnumFontFamExProc, // pointer to callback function
- L7 A3 A% Z& i4 X) L) N3 DLPARAM lParam, // application-supplied data! x8 q% S. P, p) H  D2 c% i
DWORD dwFlags // reserved; must be zero
# Z/ i0 D9 R3 {. Y);
$ D( M3 Y8 {. a4 P$ r+ l=================================================================================
6 c8 a* R& j' [+ {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.
; _) J% u) T  R- p- VThis function is provided for compatibility with earlier versions of Microsoft Windows. Win32-based applications should use the EnumFontFamilies function.& |& b! r1 G7 q% Q! t% D9 X
: O( A. h0 s& K6 e$ i6 Y% V0 u/ s
int EnumFonts(
3 }3 K  p# Q/ v1 g8 vHDC hdc, // handle to device context / G- x5 i* w) H( R" e/ r
LPCTSTR lpFaceName, // pointer to font typeface name string
5 ?7 v" k4 S: YFONTENUMPROC lpFontFunc, // pointer to callback function . [& Z7 s/ B! I) X
LPARAM lParam // address of application-supplied data 7 O( _3 X0 r6 ^5 |  N
);
: Q/ A5 ^6 u- o$ H; ?/ E: m" M) R$ y3 B
Parameters; k# B- H1 \) |
hdc
; b/ ]) ?7 }+ NIdentifies the device context. . ~& Z2 c$ y  g0 L0 C. t4 T5 s
lpFaceName
6 w0 r' u5 n- W' R" ZPoints 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. 0 X. K" `: C: g# f: k- G9 U
lpFontFunc8 T8 H5 E. z9 ]* g, g
Points to the application-defined callback function. For more information about the callback function, see the EnumFontsProc function. , k) h' A4 W" d, K+ C
lParam
' L! Q) s" B4 j: S" y& }Points to any application-defined data. The data is passed to the callback function along with the font information. 1 e: K. U. `5 r' m' H/ D

8 K% m+ Z, |' x, _5 h1 B. c- h1 w6 {* }& \
Return Values1 x/ d- \+ H" k5 L! Q& J# I0 ]; Q9 T
If the function succeeds, the return value is the last value returned by the callback function. Its meaning is defined by the application. , |( P" m" B& s/ c
======================================================================
$ B3 p: p' B( Q1 X+ IThe GetSystemDefaultLangID function retrieves the system default language identifier.
* z. Z5 x0 y' o8 a, w/ y2 U- S7 C5 J
LANGID GetSystemDefaultLangID(VOID)
! w5 T+ w6 k# A3 g) w: G: l' i. i- W9 s( k  s7 a& R  C, x. k
Parameters. q1 o9 }* v4 _1 ^7 @7 R
This function has no parameters.   K0 W2 J- s* \
Return Values- O/ Z7 T: X% A, y- h
If the function succeeds, the return value is the system default language identifier.
$ F1 W" [8 C, h8 K- a================================================================================
) @/ z0 C: V7 P' U, p8 F& dThe GetUserDefaultLangID function retrieves the user default language identifier. - ?8 ~6 l7 q; \/ j8 v* T4 ?
, G  F6 ?. [( U: Q; s
LANGID GetUserDefaultLangID(VOID), `: n6 R$ r& h! q4 U4 j& V2 h8 A* T# ~
4 R1 N3 l7 h6 N/ j+ u& q
Parameters
. u( w6 _) e, {! J; PThis function has no parameters. 7 v& a$ r  q9 X; F% q- B
Return Values
$ l3 g" E, C! D0 k# D. V4 ZIf the function succeeds, the return value is the user default language identifier.
& j4 @" U' ], W  y, r================================================================================  X1 u5 ?) j, @/ E- M; |+ S* Y- |

: e4 X; c" Q# Y$ k8 |) c" e% DBOOL GetStringTypeA(
# M0 V+ N+ O9 _' j0 y5 O- l7 J, T3 ^% ~. U# K
LCID Locale, // locale identifer
, d  C1 `0 }7 L0 t4 |& E$ {DWORD dwInfoType, // information-type options
2 h+ U$ w! Y! J; D4 u8 v! w* oLPCSTR lpSrcStr, // pointer to the source string 6 B5 ]9 c$ y2 b. e
int cchSrc, // size, in bytes, of the source string , p  `4 M" V7 b& U2 O" I" U2 {6 N6 j
LPWORD lpCharType // pointer to the buffer for output 4 n4 E+ H% x- T6 N
);
8 v+ X- X( K+ u$ W  a) e6 OParameters
# y' i9 G6 X. xLocale
: D! K) n: i$ M% B7 fLOCALE_SYSTEM_DEFAULT Default system locale/ V7 s" q2 M$ D$ V) {: P2 ^
LOCALE_USER_DEFAULT Default user locale4 u$ ?  l, Q9 T' J1 ?( T+ V
dwInfoType
1 M  g! C: R6 e/ n% j# ^0 |3 O8 {) jCT_CTYPE1 Retrieve character type information.- H3 q9 Z/ h$ A+ ~4 k
CT_CTYPE2 Retrieve bidirectional layout information.7 X5 @8 _. d  x7 ~  m
CT_CTYPE3 Retrieve text processing information.
/ t, z+ L1 p7 a7 S+ [+ W" SlpSrcStr# M9 c3 B3 ?- n2 X% m/ V( M& c
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.
6 ^$ X' e: M* L9 Y0 B+ tcchSrc7 j- \3 A  B8 a1 D1 N5 E  M
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. 8 y1 u( u; H! u0 a+ s/ D* W  f& N
lpCharType
5 d- Y" P' K  U+ X3 b, jPoints 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.
2 J  i1 X' V$ T  q3 E$ f& S- W$ y
/ C& t3 Q$ J* BReturn Values
9 W) N$ W1 i3 [; S$ YIf the function succeeds, the return value is nonzero.5 t4 S: @: L$ ?5 ?
=================================================================
2 u' g" J1 E4 Z& f( _  t0 mBOOL GetStringTypeW(2 S6 J1 D" G( Y3 z& X1 z3 `

" q# l  b8 D- E1 G- rDWORD dwInfoType, // information-type options ( [( [% k* C9 Z) c3 M. [7 P
LPCWSTR lpSrcStr, // address of source string
* U$ _* G( h9 G# e6 E6 Xint cchSrc, // number of characters in string % d& U/ l2 @) \' l; J! H! O6 X
LPWORD lpCharType // address of buffer for output
5 h% g/ j5 j9 @);3 j% d1 ~0 I7 @# h* z& P% E6 @
==========================================================================8 h. F4 a: A! ~6 x) o
The GetSystemDefaultLangID function retrieves the system default language identifier.
! k% l% ^$ i3 Z# Z- j) x% SLANGID GetSystemDefaultLangID(VOID). _, R* o! E3 a% b- F

9 T# C9 B. l7 X7 o- \
' Z" q8 Y8 q5 a1 h! b7 p- }Parameters
9 n: ?0 \( z) Y) d* Y7 pThis function has no parameters. , V8 N- A5 X7 U, L0 r

  {& P* ?1 Q# Y1 v, s, r1 O+ t) }Return Values& N( R$ @" H) ]3 I
If the function succeeds, the return value is the system default language identifier.
1 t, S" A, I( @* ?' T* u5 X6 w$ [$ m* G& ?& T* Z  H7 [4 n
Remarks# @0 p% F  h' B& h! y+ L
For more information about language identifiers, see Language Identifiers and Locales.
# w, t% x4 Z; N===============================================================================
4 I% j1 v% c8 G# S  mint WideCharToMultiByte(1 i/ ~, \% D7 F. \  R  @1 ^
, R. m6 T2 A1 W) t9 L$ p8 e( N! L
UINT CodePage, // code page & b: `, @1 \" {2 E" s/ E( c
DWORD dwFlags, // performance and mapping flags & H0 h; P$ ]/ s5 c
LPCWSTR lpWideCharStr, // address of wide-character string # z$ |* C6 \! N4 j
int cchWideChar, // number of characters in string 1 z: o1 a1 F' [9 W& u# E
LPSTR lpMultiByteStr, // address of buffer for new string
1 c. H5 Z! I, u) G0 hint cchMultiByte, // size of buffer $ L# Y$ @: I4 ]
LPCSTR lpDefaultChar, // address of default for unmappable characters
* N: E/ h. _/ N* A% h: u- YLPBOOL lpUsedDefaultChar // address of flag set when default char. used 5 D& J: ]5 d7 l' N; e$ K5 S3 q
); ) W' _) l  N( q+ J4 g
& Y1 c) B) j: [( f; {, f/ @% q

) F& E* f! v  tParameters
7 ]1 W' M3 q# c8 `* ^
; `) W7 b8 a: I* q" S3 W) fCodePage
" ]% @3 `( i1 ?" vSpecifies 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: ) W" ]' z" B) z3 \, }% I& Q

" b: S) K0 V4 B. AValue Meaning
9 g3 k* x/ F2 E- ?9 i/ QCP_ACP ANSI code page
/ Z# K/ o) u* D/ {8 }CP_MACCP Macintosh code page$ ]& Y. J1 x+ M) @$ g. e! q+ b3 I
CP_OEMCP OEM code page  c6 M* ^  F7 ?7 b+ c; m# T

- m: i# z  u- A- edwFlags
, @& q" n- `+ j) W' k* i! ~5 xA 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:
: E+ l% o' @) v( v  e* I  y  r3 q* D9 M
Value Meaning
" C0 h! G0 q5 R) ^$ U1 yWC_COMPOSITECHECK Convert composite characters to precomposed characters.
5 g  ?$ M" c8 w' o1 a$ XWC_DISCARDNS Discard nonspacing characters during conversion.' V4 V6 l1 @; M+ w
WC_SEPCHARS Generate separate characters during conversion. This is the default conversion behavior.9 T0 D* f5 f- J$ g3 S& [
WC_DEFAULTCHAR Replace exceptions with the default character during conversion.( T7 Z. E3 p; C2 C
9 G- R6 o& W; y1 ^" |
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
" c! k+ y8 \& v! T# `7 ]$ Ke is the base character, and the accent grave mark is the nonspacing character.) N6 A1 k. x3 @8 m$ d
4 E% x0 J3 \- t$ y0 X1 {: `
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.
( a2 ]/ K: C+ c6 D$ U2 h# H: ]- ?The functions default behavior is to generate separate characters (WC_SEPCHARS) for unmapped composite characters.
  T2 Q) u$ R& o" ?; y3 J5 Z+ q4 d# a3 g+ M/ q) K* r1 V
lpWideCharStr
% S* M+ N' c! x- i2 J& s: CPoints to the wide-character string to be converted. 5 Z6 f; s4 r/ Q; ~6 Z! T
% ~0 K8 }# P% O! S
cchWideChar
$ c+ M7 R( J: T0 l- ISpecifies 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.
6 S, Q/ |  u" I' v+ e" c& v8 G. P' f# ]' Q: r0 x* j
lpMultiByteStr
0 E) C. [4 c+ S: ]  W2 A2 H* |Points to the buffer to receive the translated string.
. N. t# W0 O9 r
- _4 I) |  n) K! Z0 {5 |; ^cchMultiByte% b3 A. O$ X) k
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.) ( N) G( v% a# _# T: S0 s
1 t* H0 F- V- r
lpDefaultChar! s5 W$ v2 s( J
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. ) B7 A: V! b$ |: B( O
2 J/ j1 L- Y5 P) M' u
lpUsedDefaultChar6 G$ N  D5 C& K& i' N" x' ]! \5 o
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.
% _  r% N. V+ e( B& u9 u  Z: S
% y. J" D9 A( B: ~& E8 T) p& ^: _5 Z
3 G" ~/ g8 z( L+ o8 l  [. Q% g8 H: P9 M# u( t# Q
Return Values+ r$ [( T, ?' s- f
2 t6 {* [9 \" }) ]! N
If the function succeeds, and cchMultiByte is nonzero, the return value is the number of bytes written to the buffer pointed to by lpMultiByteStr. 7 b; l9 p0 U. ~- K3 i
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 _1 _, ^9 i6 m* ?4 \$ CIf the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError may return one of the following error codes:
  W7 f) O5 f4 I: \! f6 e) W9 |
$ r. c9 i: E& s$ gERROR_INSUFFICIENT_BUFFER6 u- K; m5 l( y1 A. Z" g
ERROR_INVALID_FLAGS9 w  O$ D" H% p6 O% S
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日,是全球华人共同的冒险解谜类游戏家园。我们致力于提供各类冒险游戏资讯供大家学习交流。本站所有资源均不用于商业用途。

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