2 * COMMDLG - Font Dialog
4 * Copyright 1994 Martin Ayotte
5 * Copyright 1996 Albrecht Kleine
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #include "wine/winbase16.h"
33 #include "wine/winuser16.h"
37 #include "wine/debug.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(commdlg
);
45 static HBITMAP hBitmapTT
= 0;
48 INT_PTR CALLBACK
FormatCharDlgProcA(HWND hDlg
, UINT uMsg
, WPARAM wParam
,
50 INT_PTR CALLBACK
FormatCharDlgProcW(HWND hDlg
, UINT uMsg
, WPARAM wParam
,
52 BOOL16 CALLBACK
FormatCharDlgProc16(HWND16 hDlg
, UINT16 message
, WPARAM16 wParam
,
55 /* There is a table here of all charsets, and the sample text for each.
56 * There is a second table that translates a charset into an index into
60 #define CI(cs) ((IDS_CHARSET_##cs)-IDS_CHARSET_ANSI)
63 static const WCHAR stWestern
[]={'A','a','B','b','Y','y','Z','z',0}; /* Western and default */
64 static const WCHAR stSymbol
[]={'S','y','m','b','o','l',0}; /* Symbol */
65 static const WCHAR stShiftJis
[]={'A','a',0x3042,0x3041,0x30a2,0x30a1,0x4e9c,0x5b87,0}; /* Shift JIS */
66 static const WCHAR stHangul
[]={0xac00,0xb098,0xb2e4,'A','a','B','Y','y','Z','z',0}; /* Hangul */
67 static const WCHAR stGB2312
[]={0x5fae,0x8f6f,0x4e2d,0x6587,0x8f6f,0x4ef6,0}; /* GB2312 */
68 static const WCHAR stBIG5
[]={0x4e2d,0x6587,0x5b57,0x578b,0x7bc4,0x4f8b,0}; /* BIG5 */
69 static const WCHAR stGreek
[]={'A','a','B','b',0x0391,0x03b1,0x0392,0x03b2,0}; /* Greek */
70 static const WCHAR stTurkish
[]={'A','a','B','b',0x011e,0x011f,0x015e,0x015f,0}; /* Turkish */
71 static const WCHAR stHebrew
[]={'A','a','B','b',0x05e0,0x05e1,0x05e9,0x05ea,0}; /* Hebrew */
72 static const WCHAR stArabic
[]={'A','a','B','b',0x0627,0x0628,0x062c,0x062f,0x0647,0x0648,0x0632,0};/* Arabic */
73 static const WCHAR stBaltic
[]={'A','a','B','b','Y','y','Z','z',0}; /* Baltic */
74 static const WCHAR stVietname
[]={'A','a','B','b',0x01a0,0x01a1,0x01af,0x01b0,0}; /* Vietnamese */
75 static const WCHAR stCyrillic
[]={'A','a','B','b',0x0411,0x0431,0x0424,0x0444,0}; /* Cyrillic */
76 static const WCHAR stEastEur
[]={'A','a','B','b',0xc1,0xe1,0xd4,0xf4,0}; /* East European */
77 static const WCHAR stThai
[]={'A','a','B','b',0x0e2d,0x0e31,0x0e01,0x0e29,0x0e23,0x0e44,0x0e17,0x0e22,0}; /* Thai */
78 static const WCHAR stJohab
[]={0xac00,0xb098,0xb2e4,'A','a','B','Y','y','Z','z',0}; /* Johab */
79 static const WCHAR stMac
[]={'A','a','B','b','Y','y','Z','z',0}; /* Mac */
80 static const WCHAR stOEM
[]={'A','a','B','b',0xf8,0xf1,0xfd,0}; /* OEM */
81 /* the following character sets actually behave different (Win2K observation):
82 * the sample string is 'sticky': it uses the sample string of the previous
83 * selected character set. That behaviour looks like some default, which is
84 * not (yet) implemented. */
85 static const WCHAR stVISCII
[]={'A','a','B','b',0}; /* VISCII */
86 static const WCHAR stTCVN
[]={'A','a','B','b',0}; /* TCVN */
87 static const WCHAR stKOI8
[]={'A','a','B','b',0}; /* KOI-8 */
88 static const WCHAR stIso88593
[]={'A','a','B','b',0}; /* ISO-8859-3 */
89 static const WCHAR stIso88594
[]={'A','a','B','b',0}; /* ISO-8859-4 */
90 static const WCHAR stIso885910
[]={'A','a','B','b',0}; /* ISO-8859-10 */
91 static const WCHAR stCeltic
[]={'A','a','B','b',0};/* Celtic */
93 static const WCHAR
*sample_lang_text
[]={
94 stWestern
,stSymbol
,stShiftJis
,stHangul
,stGB2312
,
95 stBIG5
,stGreek
,stTurkish
,stHebrew
,stArabic
,
96 stBaltic
,stVietname
,stCyrillic
,stEastEur
,stThai
,
97 stJohab
,stMac
,stOEM
,stVISCII
,stTCVN
,
98 stKOI8
,stIso88593
,stIso88594
,stIso885910
,stCeltic
};
101 static const int CHARSET_ORDER
[256]={
102 CI(ANSI
), 0, CI(SYMBOL
), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
104 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
105 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
106 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CI(MAC
), 0, 0,
107 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
108 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
110 CI(JIS
), CI(HANGUL
), CI(JOHAB
), 0, 0, 0, CI(GB2312
), 0, CI(BIG5
), 0, 0, 0, 0, 0, 0, 0,
111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
112 0, CI(GREEK
), CI(TURKISH
), CI(VIETNAMESE
), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
113 0, CI(HEBREW
), CI(ARABIC
), 0, 0, 0, 0, 0, 0, 0, CI(BALTIC
), 0, 0, 0, 0, 0,
114 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CI(RUSSIAN
), 0, 0, 0,
115 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CI(THAI
), 0,
116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CI(EE
), 0,
117 CI(VISCII
), CI(TCVN
), CI(KOI8
), CI(ISO3
), CI(ISO4
), CI(ISO10
), CI(CELTIC
), 0, 0, 0, 0, 0, 0, 0, 0, CI(OEM
),
124 #define XX(x) { x, #x },
129 XX(CF_ENABLETEMPLATE
)
130 XX(CF_ENABLETEMPLATEHANDLE
)
131 XX(CF_INITTOLOGFONTSTRUCT
)
139 XX(CF_FIXEDPITCHONLY
)
141 XX(CF_FORCEFONTEXIST
)
154 void _dump_cf_flags(DWORD cflags
)
158 for (i
=0;cfflags
[i
].name
;i
++)
159 if (cfflags
[i
].mask
& cflags
)
160 MESSAGE("%s|",cfflags
[i
].name
);
164 /***********************************************************************
165 * ChooseFontA (COMDLG32.@)
167 BOOL WINAPI
ChooseFontA(LPCHOOSEFONTA lpChFont
)
174 if ( (lpChFont
->Flags
&CF_ENABLETEMPLATEHANDLE
)!=0 )
176 template=(LPCVOID
)lpChFont
->hInstance
;
179 if ( (lpChFont
->Flags
&CF_ENABLETEMPLATE
)!=0 )
181 hDlginst
=lpChFont
->hInstance
;
182 if( !(hResInfo
= FindResourceA(hDlginst
, lpChFont
->lpTemplateName
,
185 COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE
);
190 hDlginst
=COMDLG32_hInstance
;
191 if (!(hResInfo
= FindResourceA(hDlginst
, "CHOOSE_FONT", (LPSTR
)RT_DIALOG
)))
193 COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE
);
197 if (!(hDlgTmpl
= LoadResource(hDlginst
, hResInfo
)) ||
198 !(template = LockResource( hDlgTmpl
)))
200 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE
);
204 if (TRACE_ON(commdlg
))
205 _dump_cf_flags(lpChFont
->Flags
);
207 if (lpChFont
->Flags
& (CF_SELECTSCRIPT
| CF_NOVERTFONTS
))
208 FIXME(": unimplemented flag (ignored)\n");
210 return DialogBoxIndirectParamA(COMDLG32_hInstance
, template,
211 lpChFont
->hwndOwner
, FormatCharDlgProcA
, (LPARAM
)lpChFont
);
214 /***********************************************************************
215 * ChooseFontW (COMDLG32.@)
219 * The LOGFONT conversion functions will break if the structure ever
220 * grows beyond the lfFaceName element.
222 * The CHOOSEFONT conversion functions assume that both versions of
223 * lpLogFont and lpszStyle (if used) point to pre-allocated objects.
225 * The ASCII version of lpTemplateName is created by ChooseFontAtoW
226 * and freed by ChooseFontWtoA.
228 inline static VOID
LogFontWtoA(const LOGFONTW
*lfw
, LOGFONTA
*lfa
)
230 memcpy(lfa
, lfw
, sizeof(LOGFONTA
));
231 WideCharToMultiByte(CP_ACP
, 0, lfw
->lfFaceName
, -1, lfa
->lfFaceName
,
232 LF_FACESIZE
, NULL
, NULL
);
233 lfa
->lfFaceName
[LF_FACESIZE
- 1] = '\0';
236 inline static VOID
LogFontAtoW(const LOGFONTA
*lfa
, LOGFONTW
*lfw
)
238 memcpy(lfw
, lfa
, sizeof(LOGFONTA
));
239 MultiByteToWideChar(CP_ACP
, 0, lfa
->lfFaceName
, -1, lfw
->lfFaceName
,
241 lfw
->lfFaceName
[LF_FACESIZE
- 1] = 0;
244 static BOOL
ChooseFontWtoA(const CHOOSEFONTW
*cfw
, CHOOSEFONTA
*cfa
)
246 LOGFONTA
*lpLogFont
= cfa
->lpLogFont
;
247 LPSTR lpszStyle
= cfa
->lpszStyle
;
249 memcpy(cfa
, cfw
, sizeof(CHOOSEFONTA
));
250 cfa
->lpLogFont
= lpLogFont
;
251 cfa
->lpszStyle
= lpszStyle
;
253 LogFontWtoA(cfw
->lpLogFont
, lpLogFont
);
255 if ((cfw
->Flags
&CF_ENABLETEMPLATE
)!=0 && HIWORD(cfw
->lpTemplateName
)!=0)
257 cfa
->lpTemplateName
= HEAP_strdupWtoA(GetProcessHeap(), 0,
258 cfw
->lpTemplateName
);
259 if (cfa
->lpTemplateName
== NULL
)
263 if ((cfw
->Flags
& CF_USESTYLE
) != 0 && cfw
->lpszStyle
!= NULL
)
265 WideCharToMultiByte(CP_ACP
, 0, cfw
->lpszStyle
, -1, cfa
->lpszStyle
,
266 LF_FACESIZE
, NULL
, NULL
);
267 cfa
->lpszStyle
[LF_FACESIZE
- 1] = '\0';
273 static VOID
ChooseFontAtoW(const CHOOSEFONTA
*cfa
, CHOOSEFONTW
*cfw
)
275 LOGFONTW
*lpLogFont
= cfw
->lpLogFont
;
276 LPWSTR lpszStyle
= cfw
->lpszStyle
;
277 LPCWSTR lpTemplateName
= cfw
->lpTemplateName
;
279 memcpy(cfw
, cfa
, sizeof(CHOOSEFONTA
));
280 cfw
->lpLogFont
= lpLogFont
;
281 cfw
->lpszStyle
= lpszStyle
;
282 cfw
->lpTemplateName
= lpTemplateName
;
284 LogFontAtoW(cfa
->lpLogFont
, lpLogFont
);
286 if ((cfa
->Flags
&CF_ENABLETEMPLATE
)!=0 && HIWORD(cfa
->lpTemplateName
) != 0)
287 HeapFree(GetProcessHeap(), 0, (LPSTR
)(cfa
->lpTemplateName
));
289 if ((cfa
->Flags
& CF_USESTYLE
) != 0 && cfa
->lpszStyle
!= NULL
)
291 MultiByteToWideChar(CP_ACP
, 0, cfa
->lpszStyle
, -1, cfw
->lpszStyle
,
293 cfw
->lpszStyle
[LF_FACESIZE
- 1] = 0;
297 BOOL WINAPI
ChooseFontW(LPCHOOSEFONTW lpChFont
)
301 CHAR style_a
[LF_FACESIZE
];
303 cf_a
.lpLogFont
= &lf_a
;
304 cf_a
.lpszStyle
= style_a
;
306 if (ChooseFontWtoA(lpChFont
, &cf_a
) == FALSE
)
308 COMDLG32_SetCommDlgExtendedError(CDERR_MEMALLOCFAILURE
);
312 if (ChooseFontA(&cf_a
) == FALSE
)
314 if (cf_a
.lpTemplateName
!= NULL
)
315 HeapFree(GetProcessHeap(), 0, (LPSTR
)(cf_a
.lpTemplateName
));
319 ChooseFontAtoW(&cf_a
, lpChFont
);
325 /***********************************************************************
326 * ChooseFontW (COMDLG32.@)
328 BOOL WINAPI
ChooseFontW(LPCHOOSEFONTW lpChFont
)
334 HANDLE hResInfo
, hDlgTmpl
;
336 if (TRACE_ON(commdlg
))
337 _dump_cf_flags(lpChFont
->Flags
);
339 if (!(hResInfo
= FindResourceA(COMDLG32_hInstance
, "CHOOSE_FONT", (LPSTR
)RT_DIALOG
)))
341 COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE
);
344 if (!(hDlgTmpl
= LoadResource(COMDLG32_hInstance
, hResInfo
)) ||
345 !(template = LockResource( hDlgTmpl
)))
347 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE
);
351 if (lpChFont
->Flags
& (CF_SELECTSCRIPT
| CF_NOVERTFONTS
| CF_ENABLETEMPLATE
|
352 CF_ENABLETEMPLATEHANDLE
)) FIXME(": unimplemented flag (ignored)\n");
353 memcpy(&cf32a
, lpChFont
, sizeof(cf32a
));
354 memcpy(&lf32a
, lpChFont
->lpLogFont
, sizeof(LOGFONTA
));
356 WideCharToMultiByte( CP_ACP
, 0, lpChFont
->lpLogFont
->lfFaceName
, -1,
357 lf32a
.lfFaceName
, LF_FACESIZE
, NULL
, NULL
);
358 lf32a
.lfFaceName
[LF_FACESIZE
-1] = 0;
359 cf32a
.lpLogFont
=&lf32a
;
360 cf32a
.lpszStyle
=HEAP_strdupWtoA(GetProcessHeap(), 0, lpChFont
->lpszStyle
);
361 lpChFont
->lpTemplateName
=(LPWSTR
)&cf32a
;
362 bRet
= DialogBoxIndirectParamW(COMDLG32_hInstance
, template,
363 lpChFont
->hwndOwner
, FormatCharDlgProcW
, (LPARAM
)lpChFont
);
364 HeapFree(GetProcessHeap(), 0, cf32a
.lpszStyle
);
365 lpChFont
->lpTemplateName
=(LPWSTR
)cf32a
.lpTemplateName
;
366 memcpy(lpChFont
->lpLogFont
, &lf32a
, sizeof(CHOOSEFONTA
));
367 MultiByteToWideChar( CP_ACP
, 0, lf32a
.lfFaceName
, -1,
368 lpChFont
->lpLogFont
->lfFaceName
, LF_FACESIZE
);
369 lpChFont
->lpLogFont
->lfFaceName
[LF_FACESIZE
-1] = 0;
374 #define TEXT_EXTRAS 4
375 #define TEXT_COLORS 16
377 static const COLORREF textcolors
[TEXT_COLORS
]=
379 0x00000000L
,0x00000080L
,0x00008000L
,0x00008080L
,
380 0x00800000L
,0x00800080L
,0x00808000L
,0x00808080L
,
381 0x00c0c0c0L
,0x000000ffL
,0x0000ff00L
,0x0000ffffL
,
382 0x00ff0000L
,0x00ff00ffL
,0x00ffff00L
,0x00FFFFFFL
385 /***********************************************************************
386 * CFn_HookCallChk32 [internal]
388 static BOOL
CFn_HookCallChk32(LPCHOOSEFONTA lpcf
)
391 if(lpcf
->Flags
& CF_ENABLEHOOK
)
397 /*************************************************************************
398 * AddFontFamily [internal]
400 INT
AddFontFamily(const LOGFONTA
*lplf
, UINT nFontType
,
401 LPCHOOSEFONTA lpcf
, HWND hwnd
, LPCFn_ENUMSTRUCT e
)
406 TRACE("font=%s (nFontType=%d)\n", lplf
->lfFaceName
,nFontType
);
408 if (lpcf
->Flags
& CF_FIXEDPITCHONLY
)
409 if (!(lplf
->lfPitchAndFamily
& FIXED_PITCH
))
411 if (lpcf
->Flags
& CF_ANSIONLY
)
412 if (lplf
->lfCharSet
!= ANSI_CHARSET
)
414 if (lpcf
->Flags
& CF_TTONLY
)
415 if (!(nFontType
& TRUETYPE_FONTTYPE
))
420 i
=SendMessageA(hwnd
, CB_ADDSTRING
, 0, (LPARAM
)lplf
->lfFaceName
);
423 w
=(lplf
->lfCharSet
<< 8) | lplf
->lfPitchAndFamily
;
424 SendMessageA(hwnd
, CB_SETITEMDATA
, i
, MAKELONG(nFontType
,w
));
425 return 1 ; /* store some important font information */
431 /*************************************************************************
432 * FontFamilyEnumProc32 [internal]
434 static INT WINAPI
FontFamilyEnumProc(const LOGFONTA
*lpLogFont
,
435 const TEXTMETRICA
*metrics
, DWORD dwFontType
, LPARAM lParam
)
438 e
=(LPCFn_ENUMSTRUCT
)lParam
;
439 return AddFontFamily(lpLogFont
, dwFontType
, e
->lpcf32a
, e
->hWnd1
, e
);
442 /*************************************************************************
443 * SetFontStylesToCombo2 [internal]
445 * Fill font style information into combobox (without using font.c directly)
447 static int SetFontStylesToCombo2(HWND hwnd
, HDC hdc
, const LOGFONTA
*lplf
)
456 static struct FONTSTYLE fontstyles
[FSTYLES
]={
457 { 0,FW_NORMAL
,"Regular"}, { 1,FW_NORMAL
,"Italic"},
458 { 0,FW_BOLD
,"Bold"}, { 1,FW_BOLD
,"Bold Italic"}
465 memcpy(&lf
, lplf
, sizeof(LOGFONTA
));
467 for (i
=0;i
<FSTYLES
;i
++)
469 lf
.lfItalic
=fontstyles
[i
].italic
;
470 lf
.lfWeight
=fontstyles
[i
].weight
;
471 hf
=CreateFontIndirectA(&lf
);
472 hf
=SelectObject(hdc
,hf
);
473 GetTextMetricsA(hdc
,&tm
);
474 hf
=SelectObject(hdc
,hf
);
476 /* font successful created ? */
477 if (tm
.tmWeight
==fontstyles
[i
].weight
&&
478 ((tm
.tmItalic
!= 0)==fontstyles
[i
].italic
))
480 j
=SendMessageA(hwnd
,CB_ADDSTRING
,0,(LPARAM
)fontstyles
[i
].stname
);
481 if (j
==CB_ERR
) return 1;
482 j
=SendMessageA(hwnd
, CB_SETITEMDATA
, j
,
483 MAKELONG(fontstyles
[i
].weight
,fontstyles
[i
].italic
));
484 if (j
==CB_ERR
) return 1;
490 /*************************************************************************
491 * AddFontSizeToCombo3 [internal]
493 static int AddFontSizeToCombo3(HWND hwnd
, UINT h
, LPCHOOSEFONTA lpcf
)
498 if ( (!(lpcf
->Flags
& CF_LIMITSIZE
)) ||
499 ((lpcf
->Flags
& CF_LIMITSIZE
) && (h
>= lpcf
->nSizeMin
) && (h
<= lpcf
->nSizeMax
)))
501 sprintf(buffer
, "%2d", h
);
502 j
=SendMessageA(hwnd
, CB_FINDSTRINGEXACT
, -1, (LPARAM
)buffer
);
505 j
=SendMessageA(hwnd
, CB_ADDSTRING
, 0, (LPARAM
)buffer
);
506 if (j
!=CB_ERR
) j
= SendMessageA(hwnd
, CB_SETITEMDATA
, j
, h
);
507 if (j
==CB_ERR
) return 1;
513 /*************************************************************************
514 * SetFontSizesToCombo3 [internal]
516 static int SetFontSizesToCombo3(HWND hwnd
, LPCHOOSEFONTA lpcf
)
518 static const int sizes
[]={8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72,0};
521 for (i
=0; sizes
[i
]; i
++)
522 if (AddFontSizeToCombo3(hwnd
, sizes
[i
], lpcf
)) return 1;
526 /***********************************************************************
527 * AddFontStyle [internal]
529 INT
AddFontStyle(const LOGFONTA
*lplf
, UINT nFontType
,
530 LPCHOOSEFONTA lpcf
, HWND hcmb2
, HWND hcmb3
, HWND hDlg
)
534 TRACE("(nFontType=%d)\n",nFontType
);
535 TRACE(" %s h=%ld w=%ld e=%ld o=%ld wg=%ld i=%d u=%d s=%d"
536 " ch=%d op=%d cp=%d q=%d pf=%xh\n",
537 lplf
->lfFaceName
,lplf
->lfHeight
,lplf
->lfWidth
,
538 lplf
->lfEscapement
,lplf
->lfOrientation
,
539 lplf
->lfWeight
,lplf
->lfItalic
,lplf
->lfUnderline
,
540 lplf
->lfStrikeOut
,lplf
->lfCharSet
, lplf
->lfOutPrecision
,
541 lplf
->lfClipPrecision
,lplf
->lfQuality
, lplf
->lfPitchAndFamily
);
542 if (nFontType
& RASTER_FONTTYPE
)
544 if (AddFontSizeToCombo3(hcmb3
, lplf
->lfHeight
, lpcf
)) return 0;
545 } else if (SetFontSizesToCombo3(hcmb3
, lpcf
)) return 0;
547 if (!SendMessageA(hcmb2
, CB_GETCOUNT
, 0, 0))
549 HDC hdc
= ((lpcf
->Flags
& CF_PRINTERFONTS
) && lpcf
->hDC
) ? lpcf
->hDC
: GetDC(hDlg
);
550 i
=SetFontStylesToCombo2(hcmb2
,hdc
,lplf
);
551 if (!((lpcf
->Flags
& CF_PRINTERFONTS
) && lpcf
->hDC
))
559 static INT
CFn_FitFontSize( HWND hDlg
, int points
)
563 /* look for fitting font size in combobox3 */
564 n
=SendDlgItemMessageA(hDlg
, cmb3
, CB_GETCOUNT
, 0, 0);
567 if (points
== (int)SendDlgItemMessageA
568 (hDlg
,cmb3
, CB_GETITEMDATA
,i
,0))
570 SendDlgItemMessageA(hDlg
,cmb3
,CB_SETCURSEL
,i
,0);
571 SendMessageA(hDlg
, WM_COMMAND
,
572 MAKEWPARAM(cmb3
, CBN_SELCHANGE
),
573 (LPARAM
)GetDlgItem(hDlg
,cmb3
));
581 static INT
CFn_FitFontStyle( HWND hDlg
, LONG packedstyle
)
585 /* look for fitting font style in combobox2 */
586 for (i
=0;i
<TEXT_EXTRAS
;i
++)
588 id
=SendDlgItemMessageA(hDlg
, cmb2
, CB_GETITEMDATA
, i
, 0);
589 if (packedstyle
== id
)
591 SendDlgItemMessageA(hDlg
, cmb2
, CB_SETCURSEL
, i
, 0);
592 SendMessageA(hDlg
, WM_COMMAND
, MAKEWPARAM(cmb2
, CBN_SELCHANGE
),
593 (LPARAM
)GetDlgItem(hDlg
,cmb2
));
601 /***********************************************************************
602 * FontStyleEnumProc32 [internal]
604 static INT WINAPI
FontStyleEnumProc( const LOGFONTA
*lpFont
,
605 const TEXTMETRICA
*metrics
, DWORD dwFontType
, LPARAM lParam
)
607 LPCFn_ENUMSTRUCT s
=(LPCFn_ENUMSTRUCT
)lParam
;
610 HWND hDlg
=GetParent(hcmb3
);
611 return AddFontStyle(lpFont
, dwFontType
, s
->lpcf32a
, hcmb2
,
615 /***********************************************************************
616 * CFn_WMInitDialog [internal]
618 LRESULT
CFn_WMInitDialog(HWND hDlg
, WPARAM wParam
, LPARAM lParam
,
625 HCURSOR hcursor
=SetCursor(LoadCursorA(0,(LPSTR
)IDC_WAIT
));
627 SetWindowLongA(hDlg
, DWL_USER
, lParam
);
628 lpxx
=lpcf
->lpLogFont
;
629 TRACE("WM_INITDIALOG lParam=%08lX\n", lParam
);
631 if (lpcf
->lStructSize
!= sizeof(CHOOSEFONTA
))
633 ERR("structure size failure !!!\n");
638 hBitmapTT
= LoadBitmapA(0, MAKEINTRESOURCEA(OBM_TRTYPE
));
640 if (!(lpcf
->Flags
& CF_SHOWHELP
) || !IsWindow(lpcf
->hwndOwner
))
641 ShowWindow(GetDlgItem(hDlg
,pshHelp
),SW_HIDE
);
642 if (!(lpcf
->Flags
& CF_APPLY
))
643 ShowWindow(GetDlgItem(hDlg
,psh3
),SW_HIDE
);
644 if (lpcf
->Flags
& CF_EFFECTS
)
646 for (i
=0;i
<TEXT_COLORS
;i
++)
650 if( LoadStringA(COMDLG32_hInstance
, IDS_COLOR_BLACK
+i
, name
,
651 sizeof(name
)/sizeof(*name
) )==0 )
653 strcpy( name
, "[color name]" );
655 j
=SendDlgItemMessageA(hDlg
, cmb4
, CB_ADDSTRING
, 0, (LPARAM
)name
);
656 SendDlgItemMessageA(hDlg
, cmb4
, CB_SETITEMDATA16
, j
, textcolors
[j
]);
657 /* look for a fitting value in color combobox */
658 if (textcolors
[j
]==lpcf
->rgbColors
)
659 SendDlgItemMessageA(hDlg
,cmb4
, CB_SETCURSEL
,j
,0);
664 ShowWindow(GetDlgItem(hDlg
,cmb4
),SW_HIDE
);
665 ShowWindow(GetDlgItem(hDlg
,chx1
),SW_HIDE
);
666 ShowWindow(GetDlgItem(hDlg
,chx2
),SW_HIDE
);
667 ShowWindow(GetDlgItem(hDlg
,grp1
),SW_HIDE
);
668 ShowWindow(GetDlgItem(hDlg
,stc4
),SW_HIDE
);
670 hdc
= ((lpcf
->Flags
& CF_PRINTERFONTS
) && lpcf
->hDC
) ? lpcf
->hDC
: GetDC(hDlg
);
674 s
.hWnd1
=GetDlgItem(hDlg
,cmb1
);
678 if (!EnumFontFamiliesA(hdc
, NULL
, FontFamilyEnumProc
, (LPARAM
)&s
)) {
679 TRACE("EnumFontFamilies returns 0\n");
683 if (lpcf
->Flags
& CF_FIXEDPITCHONLY
) {
684 FIXME("No font found with fixed pitch only, dropping flag.\n");
685 lpcf
->Flags
&= ~CF_FIXEDPITCHONLY
;
688 if (lpcf
->Flags
& CF_TTONLY
) {
689 FIXME("No font found with truetype only, dropping flag.\n");
690 lpcf
->Flags
&= ~CF_TTONLY
;
697 if (lpcf
->Flags
& CF_INITTOLOGFONTSTRUCT
)
699 /* look for fitting font name in combobox1 */
700 j
=SendDlgItemMessageA(hDlg
,cmb1
,CB_FINDSTRING
,-1,(LONG
)lpxx
->lfFaceName
);
703 INT height
= (lpcf
->iPointSize
+ 5) / 10;
704 pstyle
=MAKELONG(lpxx
->lfWeight
> FW_MEDIUM
? FW_BOLD
:FW_NORMAL
,lpxx
->lfItalic
!=0);
705 SendDlgItemMessageA(hDlg
, cmb1
, CB_SETCURSEL
, j
, 0);
706 SendMessageA(hDlg
, WM_COMMAND
, MAKEWPARAM(cmb1
, CBN_SELCHANGE
),
707 (LPARAM
)GetDlgItem(hDlg
,cmb1
));
709 /* look for fitting font style in combobox2 */
710 CFn_FitFontStyle(hDlg
, pstyle
);
711 /* look for fitting font size in combobox3 */
712 CFn_FitFontSize(hDlg
, height
);
717 SendDlgItemMessageA(hDlg
,cmb1
,CB_SETCURSEL
,0,0);
718 SendMessageA(hDlg
, WM_COMMAND
, MAKEWPARAM(cmb1
, CBN_SELCHANGE
),
719 (LPARAM
)GetDlgItem(hDlg
,cmb1
));
721 if (lpcf
->Flags
& CF_USESTYLE
&& lpcf
->lpszStyle
)
723 j
=SendDlgItemMessageA(hDlg
,cmb2
,CB_FINDSTRING
,-1,(LONG
)lpcf
->lpszStyle
);
726 j
=SendDlgItemMessageA(hDlg
,cmb2
,CB_SETCURSEL
,j
,0);
727 SendMessageA(hDlg
,WM_COMMAND
,cmb2
,
728 MAKELONG(HWND_16(GetDlgItem(hDlg
,cmb2
)),CBN_SELCHANGE
));
734 WARN("HDC failure !!!\n");
739 if (!((lpcf
->Flags
& CF_PRINTERFONTS
) && lpcf
->hDC
))
746 /***********************************************************************
747 * CFn_WMMeasureItem [internal]
749 LRESULT
CFn_WMMeasureItem(HWND hDlg
, WPARAM wParam
, LPARAM lParam
)
752 LPMEASUREITEMSTRUCT lpmi
=(LPMEASUREITEMSTRUCT
)lParam
;
754 hBitmapTT
= LoadBitmapA(0, MAKEINTRESOURCEA(OBM_TRTYPE
));
755 GetObjectA( hBitmapTT
, sizeof(bm
), &bm
);
756 lpmi
->itemHeight
=bm
.bmHeight
;
757 /* FIXME: use MAX of bm.bmHeight and tm.tmHeight .*/
762 /***********************************************************************
763 * CFn_WMDrawItem [internal]
765 LRESULT
CFn_WMDrawItem(HWND hDlg
, WPARAM wParam
, LPARAM lParam
)
770 COLORREF cr
, oldText
=0, oldBk
=0;
775 HBITMAP hBitmap
; /* for later TT usage */
777 LPDRAWITEMSTRUCT lpdi
= (LPDRAWITEMSTRUCT
)lParam
;
779 if (lpdi
->itemID
== (UINT
)-1) /* got no items */
780 DrawFocusRect(lpdi
->hDC
, &lpdi
->rcItem
);
783 if (lpdi
->CtlType
== ODT_COMBOBOX
)
785 if (lpdi
->itemState
==ODS_SELECTED
)
787 hBrush
=GetSysColorBrush(COLOR_HIGHLIGHT
);
788 oldText
=SetTextColor(lpdi
->hDC
, GetSysColor(COLOR_HIGHLIGHTTEXT
));
789 oldBk
=SetBkColor(lpdi
->hDC
, GetSysColor(COLOR_HIGHLIGHT
));
792 hBrush
= SelectObject(lpdi
->hDC
, GetStockObject(LTGRAY_BRUSH
));
793 SelectObject(lpdi
->hDC
, hBrush
);
795 FillRect(lpdi
->hDC
, &lpdi
->rcItem
, hBrush
);
798 return TRUE
; /* this should never happen */
804 /* TRACE(commdlg,"WM_Drawitem cmb1\n"); */
805 SendMessageA(lpdi
->hwndItem
, CB_GETLBTEXT
, lpdi
->itemID
,
807 GetObjectA( hBitmapTT
, sizeof(bm
), &bm
);
808 TextOutA(lpdi
->hDC
, lpdi
->rcItem
.left
+ bm
.bmWidth
+ 10,
809 lpdi
->rcItem
.top
, buffer
, strlen(buffer
));
811 nFontType
= SendMessageA(lpdi
->hwndItem
, CB_GETITEMDATA
, lpdi
->itemID
,0L);
812 /* FIXME: draw bitmap if truetype usage */
813 if (nFontType
&TRUETYPE_FONTTYPE
)
815 hMemDC
= CreateCompatibleDC(lpdi
->hDC
);
816 hBitmap
= SelectObject(hMemDC
, hBitmapTT
);
817 BitBlt(lpdi
->hDC
, lpdi
->rcItem
.left
, lpdi
->rcItem
.top
,
818 bm
.bmWidth
, bm
.bmHeight
, hMemDC
, 0, 0, SRCCOPY
);
819 SelectObject(hMemDC
, hBitmap
);
826 /* TRACE(commdlg,"WM_DRAWITEN cmb2,cmb3\n"); */
827 SendMessageA(lpdi
->hwndItem
, CB_GETLBTEXT
, lpdi
->itemID
,
829 TextOutA(lpdi
->hDC
, lpdi
->rcItem
.left
,
830 lpdi
->rcItem
.top
, buffer
, strlen(buffer
));
834 /* TRACE(commdlg,"WM_DRAWITEM cmb4 (=COLOR)\n"); */
835 SendMessageA(lpdi
->hwndItem
, CB_GETLBTEXT
, lpdi
->itemID
,
837 TextOutA(lpdi
->hDC
, lpdi
->rcItem
.left
+ 25+5,
838 lpdi
->rcItem
.top
, buffer
, strlen(buffer
));
839 cr
= SendMessageA(lpdi
->hwndItem
, CB_GETITEMDATA
, lpdi
->itemID
,0L);
840 hBrush
= CreateSolidBrush(cr
);
843 hBrush
= SelectObject (lpdi
->hDC
, hBrush
) ;
844 rect
.right
=rect
.left
+25;
848 Rectangle( lpdi
->hDC
, rect
.left
, rect
.top
,
849 rect
.right
, rect
.bottom
);
850 DeleteObject( SelectObject (lpdi
->hDC
, hBrush
)) ;
857 return TRUE
; /* this should never happen */
859 if (lpdi
->itemState
== ODS_SELECTED
)
861 SetTextColor(lpdi
->hDC
, oldText
);
862 SetBkColor(lpdi
->hDC
, oldBk
);
868 /***********************************************************************
869 * CFn_WMCommand [internal]
871 LRESULT
CFn_WMCommand(HWND hDlg
, WPARAM wParam
, LPARAM lParam
,
877 LPLOGFONTA lpxx
=lpcf
->lpLogFont
;
879 TRACE("WM_COMMAND wParam=%08lX lParam=%08lX\n", (LONG
)wParam
, lParam
);
880 switch (LOWORD(wParam
))
883 if (HIWORD(wParam
)==CBN_SELCHANGE
)
885 hdc
=((lpcf
->Flags
& CF_PRINTERFONTS
) && lpcf
->hDC
) ? lpcf
->hDC
: GetDC(hDlg
);
888 INT pointsize
; /* save current pointsize */
889 LONG pstyle
; /* save current style */
891 idx3
= SendDlgItemMessageA(hDlg
, cmb3
, CB_GETCURSEL
, 0, 0);
892 pointsize
= (int)SendDlgItemMessageA( hDlg
, cmb3
, CB_GETITEMDATA
,
894 idx2
= SendDlgItemMessageA(hDlg
, cmb2
, CB_GETCURSEL
, 0, 0);
895 pstyle
= SendDlgItemMessageA(hDlg
, cmb2
, CB_GETITEMDATA
, idx2
, 0);
897 SendDlgItemMessageA(hDlg
, cmb2
, CB_RESETCONTENT
, 0, 0);
898 SendDlgItemMessageA(hDlg
, cmb3
, CB_RESETCONTENT
, 0, 0);
899 i
=SendDlgItemMessageA(hDlg
, cmb1
, CB_GETCURSEL
, 0, 0);
902 HCURSOR hcursor
=SetCursor(LoadCursorA(0,(LPSTR
)IDC_WAIT
));
905 SendDlgItemMessageA(hDlg
, cmb1
, CB_GETLBTEXT
, i
,
907 TRACE("WM_COMMAND/cmb1 =>%s\n",str
);
908 s
.hWnd1
=GetDlgItem(hDlg
, cmb2
);
909 s
.hWnd2
=GetDlgItem(hDlg
, cmb3
);
911 EnumFontFamiliesA(hdc
, str
, FontStyleEnumProc
, (LPARAM
)&s
);
912 CFn_FitFontStyle(hDlg
, pstyle
);
913 CFn_FitFontSize(hDlg
, pointsize
);
916 if (!((lpcf
->Flags
& CF_PRINTERFONTS
) && lpcf
->hDC
))
921 WARN("HDC failure !!!\n");
930 if (HIWORD(wParam
)==CBN_SELCHANGE
|| HIWORD(wParam
)== BN_CLICKED
)
935 TRACE("WM_COMMAND/cmb2,3 =%08lX\n", lParam
);
936 i
=SendDlgItemMessageA(hDlg
,cmb1
,CB_GETCURSEL
,0,0);
938 i
=GetDlgItemTextA( hDlg
, cmb1
, str
, 256 );
941 SendDlgItemMessageA(hDlg
,cmb1
,CB_GETLBTEXT
,i
,
943 l
=SendDlgItemMessageA(hDlg
,cmb1
,CB_GETITEMDATA
,i
,0);
945 lpcf
->nFontType
= LOWORD(l
);
946 /* FIXME: lpcf->nFontType |= .... SIMULATED_FONTTYPE and so */
947 /* same value reported to the EnumFonts
948 call back with the extra FONTTYPE_... bits added */
949 lpxx
->lfPitchAndFamily
=j
&0xff;
950 lpxx
->lfCharSet
=j
>>8;
952 strcpy(lpxx
->lfFaceName
,str
);
953 i
=SendDlgItemMessageA(hDlg
, cmb2
, CB_GETCURSEL
, 0, 0);
956 l
=SendDlgItemMessageA(hDlg
, cmb2
, CB_GETITEMDATA
, i
, 0);
957 if (0!=(lpxx
->lfItalic
=HIWORD(l
)))
958 lpcf
->nFontType
|= ITALIC_FONTTYPE
;
959 if ((lpxx
->lfWeight
=LOWORD(l
)) > FW_MEDIUM
)
960 lpcf
->nFontType
|= BOLD_FONTTYPE
;
962 i
=SendDlgItemMessageA(hDlg
, cmb3
, CB_GETCURSEL
, 0, 0);
964 lpxx
->lfHeight
=-LOWORD(SendDlgItemMessageA(hDlg
, cmb3
, CB_GETITEMDATA
, i
, 0));
967 lpxx
->lfStrikeOut
=IsDlgButtonChecked(hDlg
,chx1
);
968 lpxx
->lfUnderline
=IsDlgButtonChecked(hDlg
,chx2
);
969 lpxx
->lfWidth
=lpxx
->lfOrientation
=lpxx
->lfEscapement
=0;
970 lpxx
->lfOutPrecision
=OUT_DEFAULT_PRECIS
;
971 lpxx
->lfClipPrecision
=CLIP_DEFAULT_PRECIS
;
972 lpxx
->lfQuality
=DEFAULT_QUALITY
;
973 lpcf
->iPointSize
= -10*lpxx
->lfHeight
;
975 wininfo
.cbSize
=sizeof(wininfo
);
977 if( GetWindowInfo( GetDlgItem( hDlg
, stc5
), &wininfo
) )
979 MapWindowPoints( 0, hDlg
, (LPPOINT
) &wininfo
.rcWindow
, 2);
980 InvalidateRect( hDlg
, &wininfo
.rcWindow
, TRUE
);
986 i
=SendDlgItemMessageA(hDlg
, cmb4
, CB_GETCURSEL
, 0, 0);
991 lpcf
->rgbColors
=textcolors
[i
];
992 wininfo
.cbSize
=sizeof(wininfo
);
994 if( GetWindowInfo( GetDlgItem( hDlg
, stc5
), &wininfo
) )
996 MapWindowPoints( 0, hDlg
, (LPPOINT
) &wininfo
.rcWindow
, 2);
997 InvalidateRect( hDlg
, &wininfo
.rcWindow
, TRUE
);
1003 i
=RegisterWindowMessageA( HELPMSGSTRINGA
);
1004 if (lpcf
->hwndOwner
)
1005 SendMessageA(lpcf
->hwndOwner
, i
, 0, (LPARAM
)GetWindowLongA(hDlg
, DWL_USER
));
1006 /* if (CFn_HookCallChk(lpcf))
1007 CallWindowProc16(lpcf->lpfnHook,hDlg,WM_COMMAND,psh15,(LPARAM)lpcf);*/
1011 if ( (!(lpcf
->Flags
& CF_LIMITSIZE
)) ||
1012 ( (lpcf
->Flags
& CF_LIMITSIZE
) &&
1013 (-lpxx
->lfHeight
>= lpcf
->nSizeMin
) &&
1014 (-lpxx
->lfHeight
<= lpcf
->nSizeMax
)))
1015 EndDialog(hDlg
, TRUE
);
1019 sprintf(buffer
,"Select a font size between %d and %d points.",
1020 lpcf
->nSizeMin
,lpcf
->nSizeMax
);
1021 MessageBoxA(hDlg
, buffer
, NULL
, MB_OK
);
1025 EndDialog(hDlg
, FALSE
);
1031 LRESULT
CFn_WMDestroy(HWND hwnd
, WPARAM wParam
, LPARAM lParam
)
1036 static LRESULT
CFn_WMPaint(HWND hDlg
, WPARAM wParam
, LPARAM lParam
,
1037 LPCHOOSEFONTA lpcf
)
1041 info
.cbSize
=sizeof(info
);
1043 if( GetWindowInfo( GetDlgItem( hDlg
, stc5
), &info
) )
1050 LOGFONTA lf
= *(lpcf
->lpLogFont
);
1052 MapWindowPoints( 0, hDlg
, (LPPOINT
) &info
.rcWindow
, 2);
1053 hdc
=BeginPaint( hDlg
, &ps
);
1056 MoveToEx( hdc
, info
.rcWindow
.left
, info
.rcWindow
.bottom
, NULL
);
1057 hOrigPen
=SelectObject( hdc
, CreatePen( PS_SOLID
, 2,
1058 GetSysColor( COLOR_3DSHADOW
) ));
1059 LineTo( hdc
, info
.rcWindow
.left
, info
.rcWindow
.top
);
1060 LineTo( hdc
, info
.rcWindow
.right
, info
.rcWindow
.top
);
1061 DeleteObject(SelectObject( hdc
, CreatePen( PS_SOLID
, 2,
1062 GetSysColor( COLOR_3DLIGHT
) )));
1063 LineTo( hdc
, info
.rcWindow
.right
, info
.rcWindow
.bottom
);
1064 LineTo( hdc
, info
.rcWindow
.left
, info
.rcWindow
.bottom
);
1065 DeleteObject(SelectObject( hdc
, hOrigPen
));
1067 /* Draw the sample text itself */
1068 info
.rcWindow
.right
--;
1069 info
.rcWindow
.bottom
--;
1070 info
.rcWindow
.top
++;
1071 info
.rcWindow
.left
++;
1072 lf
.lfHeight
= MulDiv(lf
.lfHeight
, GetDeviceCaps(hdc
, LOGPIXELSY
), 72);
1073 hOrigFont
= SelectObject( hdc
, CreateFontIndirectA( &lf
) );
1074 rgbPrev
=SetTextColor( hdc
, lpcf
->rgbColors
);
1077 sample_lang_text
[CHARSET_ORDER
[lpcf
->lpLogFont
->lfCharSet
]],
1078 -1, &info
.rcWindow
, DT_CENTER
|DT_VCENTER
|DT_SINGLELINE
);
1080 EndPaint( hDlg
, &ps
);
1086 /***********************************************************************
1087 * FormatCharDlgProcA [internal]
1089 INT_PTR CALLBACK
FormatCharDlgProcA(HWND hDlg
, UINT uMsg
, WPARAM wParam
,
1093 INT_PTR res
= FALSE
;
1094 if (uMsg
!=WM_INITDIALOG
)
1096 lpcf
=(LPCHOOSEFONTA
)GetWindowLongA(hDlg
, DWL_USER
);
1099 if (CFn_HookCallChk32(lpcf
))
1100 res
=CallWindowProcA((WNDPROC
)lpcf
->lpfnHook
, hDlg
, uMsg
, wParam
, lParam
);
1106 lpcf
=(LPCHOOSEFONTA
)lParam
;
1107 if (!CFn_WMInitDialog(hDlg
, wParam
, lParam
, lpcf
))
1109 TRACE("CFn_WMInitDialog returned FALSE\n");
1112 if (CFn_HookCallChk32(lpcf
))
1113 return CallWindowProcA((WNDPROC
)lpcf
->lpfnHook
,hDlg
,WM_INITDIALOG
,wParam
,lParam
);
1117 case WM_MEASUREITEM
:
1118 return CFn_WMMeasureItem(hDlg
, wParam
, lParam
);
1120 return CFn_WMDrawItem(hDlg
, wParam
, lParam
);
1122 return CFn_WMCommand(hDlg
, wParam
, lParam
, lpcf
);
1124 return CFn_WMDestroy(hDlg
, wParam
, lParam
);
1125 case WM_CHOOSEFONT_GETLOGFONT
:
1126 TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n",
1128 FIXME("current logfont back to caller\n");
1131 return CFn_WMPaint(hDlg
, wParam
, lParam
, lpcf
);
1136 /***********************************************************************
1137 * FormatCharDlgProcW [internal]
1139 INT_PTR CALLBACK
FormatCharDlgProcW(HWND hDlg
, UINT uMsg
, WPARAM wParam
,
1142 LPCHOOSEFONTW lpcf32w
;
1143 LPCHOOSEFONTA lpcf32a
;
1144 INT_PTR res
= FALSE
;
1145 if (uMsg
!=WM_INITDIALOG
)
1147 lpcf32w
=(LPCHOOSEFONTW
)GetWindowLongA(hDlg
, DWL_USER
);
1150 if (CFn_HookCallChk32((LPCHOOSEFONTA
)lpcf32w
))
1151 res
=CallWindowProcW((WNDPROC
)lpcf32w
->lpfnHook
, hDlg
, uMsg
, wParam
, lParam
);
1157 lpcf32w
=(LPCHOOSEFONTW
)lParam
;
1158 lpcf32a
=(LPCHOOSEFONTA
)lpcf32w
->lpTemplateName
;
1159 if (!CFn_WMInitDialog(hDlg
, wParam
, lParam
, lpcf32a
))
1161 TRACE("CFn_WMInitDialog returned FALSE\n");
1164 if (CFn_HookCallChk32((LPCHOOSEFONTA
)lpcf32w
))
1165 return CallWindowProcW((WNDPROC
)lpcf32w
->lpfnHook
,hDlg
,WM_INITDIALOG
,wParam
,lParam
);
1167 lpcf32a
=(LPCHOOSEFONTA
)lpcf32w
->lpTemplateName
;
1170 case WM_MEASUREITEM
:
1171 return CFn_WMMeasureItem(hDlg
, wParam
, lParam
);
1173 return CFn_WMDrawItem(hDlg
, wParam
, lParam
);
1175 return CFn_WMCommand(hDlg
, wParam
, lParam
, lpcf32a
);
1177 return CFn_WMDestroy(hDlg
, wParam
, lParam
);
1178 case WM_CHOOSEFONT_GETLOGFONT
:
1179 TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n",
1181 FIXME("current logfont back to caller\n");