source: trunk/src/comdlg32/fontdlg.c@ 4513

Last change on this file since 4513 was 4511, checked in by sandervl, 25 years ago

Merged with latest Wine version (Wine 20001002 level (10-21-2000))

File size: 34.6 KB
Line 
1/*
2 * COMMDLG - Font Dialog
3 *
4 * Copyright 1994 Martin Ayotte
5 * Copyright 1996 Albrecht Kleine
6 */
7
8#ifdef __WIN32OS2__
9#include <windef.h>
10#include <winbase.h>
11#include <wingdi.h>
12#include <winuser.h>
13#include <heapstring.h>
14#include <misc.h>
15#endif
16
17#include <ctype.h>
18#include <stdlib.h>
19#include <stdio.h>
20#include <string.h>
21#include "windef.h"
22#include "winbase.h"
23#include "wingdi.h"
24#ifndef __WIN32OS2__
25#include "wine/winbase16.h"
26#include "wine/winuser16.h"
27#endif
28#include "wine/winestring.h"
29#include "ldt.h"
30#include "heap.h"
31#include "commdlg.h"
32#include "dialog.h"
33#include "dlgs.h"
34#include "module.h"
35#include "debugtools.h"
36#ifndef __WIN32OS2__
37#include "font.h"
38#endif
39#include "winproc.h"
40#include "cderr.h"
41
42DEFAULT_DEBUG_CHANNEL(commdlg);
43
44#include "cdlg.h"
45
46static HBITMAP16 hBitmapTT = 0;
47
48
49LRESULT WINAPI FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
50 LPARAM lParam);
51LRESULT WINAPI FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
52 LPARAM lParam);
53
54#ifndef __WIN32OS2__
55LRESULT WINAPI FormatCharDlgProc16(HWND16 hDlg, UINT16 message, WPARAM16 wParam,
56 LPARAM lParam);
57
58static void CFn_CHOOSEFONT16to32A(LPCHOOSEFONT16 chf16, LPCHOOSEFONTA chf32a)
59{
60 chf32a->lStructSize=sizeof(CHOOSEFONTA);
61 chf32a->hwndOwner=chf16->hwndOwner;
62 chf32a->hDC=chf16->hDC;
63 chf32a->iPointSize=chf16->iPointSize;
64 chf32a->Flags=chf16->Flags;
65 chf32a->rgbColors=chf16->rgbColors;
66 chf32a->lCustData=chf16->lCustData;
67 chf32a->lpfnHook=NULL;
68 chf32a->lpTemplateName=PTR_SEG_TO_LIN(chf16->lpTemplateName);
69 chf32a->hInstance=chf16->hInstance;
70 chf32a->lpszStyle=PTR_SEG_TO_LIN(chf16->lpszStyle);
71 chf32a->nFontType=chf16->nFontType;
72 chf32a->nSizeMax=chf16->nSizeMax;
73 chf32a->nSizeMin=chf16->nSizeMin;
74 FONT_LogFont16To32A(PTR_SEG_TO_LIN(chf16->lpLogFont), chf32a->lpLogFont);
75}
76
77/***********************************************************************
78 * ChooseFont16 (COMMDLG.15)
79 */
80BOOL16 WINAPI ChooseFont16(LPCHOOSEFONT16 lpChFont)
81{
82 HINSTANCE16 hInst;
83 HANDLE16 hDlgTmpl16 = 0, hResource16 = 0;
84 HGLOBAL16 hGlobal16 = 0;
85 BOOL16 bRet = FALSE;
86 LPCVOID template;
87 FARPROC16 ptr;
88 CHOOSEFONTA cf32a;
89 LOGFONTA lf32a;
90 SEGPTR lpTemplateName;
91
92 cf32a.lpLogFont=&lf32a;
93 CFn_CHOOSEFONT16to32A(lpChFont, &cf32a);
94
95 TRACE("ChooseFont\n");
96 if (!lpChFont) return FALSE;
97
98 if (lpChFont->Flags & CF_ENABLETEMPLATEHANDLE)
99 {
100 if (!(template = LockResource16( lpChFont->hInstance )))
101 {
102 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
103 return FALSE;
104 }
105 }
106 else if (lpChFont->Flags & CF_ENABLETEMPLATE)
107 {
108 HANDLE16 hResInfo;
109 if (!(hResInfo = FindResource16( lpChFont->hInstance,
110 lpChFont->lpTemplateName,
111 RT_DIALOG16)))
112 {
113 COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
114 return FALSE;
115 }
116 if (!(hDlgTmpl16 = LoadResource16( lpChFont->hInstance, hResInfo )) ||
117 !(template = LockResource16( hDlgTmpl16 )))
118 {
119 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
120 return FALSE;
121 }
122 }
123 else
124 {
125 HANDLE hResInfo, hDlgTmpl32;
126 LPCVOID template32;
127 DWORD size;
128 if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, "CHOOSE_FONT", RT_DIALOGA)))
129 {
130 COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
131 return FALSE;
132 }
133 if (!(hDlgTmpl32 = LoadResource(COMMDLG_hInstance32, hResInfo)) ||
134 !(template32 = LockResource(hDlgTmpl32)))
135 {
136 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
137 return FALSE;
138 }
139 size = SizeofResource(GetModuleHandleA("COMDLG32"), hResInfo);
140 hGlobal16 = GlobalAlloc16(0, size);
141 if (!hGlobal16)
142 {
143 COMDLG32_SetCommDlgExtendedError(CDERR_MEMALLOCFAILURE);
144 ERR("alloc failure for %ld bytes\n", size);
145 return FALSE;
146 }
147 template = GlobalLock16(hGlobal16);
148 if (!template)
149 {
150 COMDLG32_SetCommDlgExtendedError(CDERR_MEMLOCKFAILURE);
151 ERR("global lock failure for %x handle\n", hGlobal16);
152 GlobalFree16(hGlobal16);
153 return FALSE;
154 }
155 ConvertDialog32To16((LPVOID)template32, size, (LPVOID)template);
156 hDlgTmpl16 = hGlobal16;
157
158 }
159
160 /* lpTemplateName is not used in the dialog */
161 lpTemplateName=lpChFont->lpTemplateName;
162 lpChFont->lpTemplateName=(SEGPTR)&cf32a;
163
164 ptr = GetProcAddress16(GetModuleHandle16("COMMDLG"), (SEGPTR) 16);
165 hInst = GetWindowLongA(lpChFont->hwndOwner, GWL_HINSTANCE);
166 bRet = DialogBoxIndirectParam16(hInst, hDlgTmpl16, lpChFont->hwndOwner,
167 (DLGPROC16) ptr, (DWORD)lpChFont);
168 if (hResource16) FreeResource16(hDlgTmpl16);
169 if (hGlobal16)
170 {
171 GlobalUnlock16(hGlobal16);
172 GlobalFree16(hGlobal16);
173 }
174 lpChFont->lpTemplateName=lpTemplateName;
175 FONT_LogFont32ATo16(cf32a.lpLogFont,
176 (LPLOGFONT16)(PTR_SEG_TO_LIN(lpChFont->lpLogFont)));
177 return bRet;
178}
179#endif //!__WIN32OS2__
180
181/***********************************************************************
182 * ChooseFontA (COMDLG32.3)
183 */
184BOOL WINAPI ChooseFontA(LPCHOOSEFONTA lpChFont)
185{
186 LPCVOID template;
187 HANDLE hResInfo, hDlgTmpl;
188
189 if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, "CHOOSE_FONT", RT_DIALOGA)))
190 {
191 COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
192 return FALSE;
193 }
194 if (!(hDlgTmpl = LoadResource(COMMDLG_hInstance32, hResInfo )) ||
195 !(template = LockResource( hDlgTmpl )))
196 {
197 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
198 return FALSE;
199 }
200
201 if (lpChFont->Flags & (CF_SELECTSCRIPT | CF_NOVERTFONTS | CF_ENABLETEMPLATE |
202 CF_ENABLETEMPLATEHANDLE)) FIXME(": unimplemented flag (ignored)\n");
203 return DialogBoxIndirectParamA(COMMDLG_hInstance32, template,
204 lpChFont->hwndOwner, (DLGPROC)FormatCharDlgProcA, (LPARAM)lpChFont );
205}
206
207/***********************************************************************
208 * ChooseFontW (COMDLG32.4)
209 */
210BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
211{
212 BOOL bRet=FALSE;
213 CHOOSEFONTA cf32a;
214 LOGFONTA lf32a;
215 LPCVOID template;
216 HANDLE hResInfo, hDlgTmpl;
217
218 if (!(hResInfo = FindResourceA(COMMDLG_hInstance32, "CHOOSE_FONT", RT_DIALOGA)))
219 {
220 COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
221 return FALSE;
222 }
223 if (!(hDlgTmpl = LoadResource(COMMDLG_hInstance32, hResInfo )) ||
224 !(template = LockResource( hDlgTmpl )))
225 {
226 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
227 return FALSE;
228 }
229
230 if (lpChFont->Flags & (CF_SELECTSCRIPT | CF_NOVERTFONTS | CF_ENABLETEMPLATE |
231 CF_ENABLETEMPLATEHANDLE)) FIXME(": unimplemented flag (ignored)\n");
232 memcpy(&cf32a, lpChFont, sizeof(cf32a));
233 memcpy(&lf32a, lpChFont->lpLogFont, sizeof(LOGFONTA));
234 lstrcpynWtoA(lf32a.lfFaceName, lpChFont->lpLogFont->lfFaceName, LF_FACESIZE);
235 cf32a.lpLogFont=&lf32a;
236 cf32a.lpszStyle=HEAP_strdupWtoA(GetProcessHeap(), 0, lpChFont->lpszStyle);
237 lpChFont->lpTemplateName=(LPWSTR)&cf32a;
238 bRet = DialogBoxIndirectParamW(COMMDLG_hInstance32, template,
239 lpChFont->hwndOwner, (DLGPROC)FormatCharDlgProcW, (LPARAM)lpChFont );
240 HeapFree(GetProcessHeap(), 0, cf32a.lpszStyle);
241 lpChFont->lpTemplateName=(LPWSTR)cf32a.lpTemplateName;
242 memcpy(lpChFont->lpLogFont, &lf32a, sizeof(CHOOSEFONTA));
243 lstrcpynAtoW(lpChFont->lpLogFont->lfFaceName, lf32a.lfFaceName, LF_FACESIZE);
244 return bRet;
245}
246
247
248#define TEXT_EXTRAS 4
249#define TEXT_COLORS 16
250
251static const COLORREF textcolors[TEXT_COLORS]=
252{
253 0x00000000L,0x00000080L,0x00008000L,0x00008080L,
254 0x00800000L,0x00800080L,0x00808000L,0x00808080L,
255 0x00c0c0c0L,0x000000ffL,0x0000ff00L,0x0000ffffL,
256 0x00ff0000L,0x00ff00ffL,0x00ffff00L,0x00FFFFFFL
257};
258
259/***********************************************************************
260 * CFn_HookCallChk [internal]
261 */
262static BOOL CFn_HookCallChk(LPCHOOSEFONT16 lpcf)
263{
264 if (lpcf)
265 if(lpcf->Flags & CF_ENABLEHOOK)
266 if (lpcf->lpfnHook)
267 return TRUE;
268 return FALSE;
269}
270
271/***********************************************************************
272 * CFn_HookCallChk32 [internal]
273 */
274static BOOL CFn_HookCallChk32(LPCHOOSEFONTA lpcf)
275{
276 if (lpcf)
277 if(lpcf->Flags & CF_ENABLEHOOK)
278 if (lpcf->lpfnHook)
279 return TRUE;
280 return FALSE;
281}
282
283
284/*************************************************************************
285 * AddFontFamily [internal]
286 */
287static INT AddFontFamily(LPLOGFONTA lplf, UINT nFontType,
288 LPCHOOSEFONTA lpcf, HWND hwnd)
289{
290 int i;
291 WORD w;
292
293 TRACE("font=%s (nFontType=%d)\n", lplf->lfFaceName,nFontType);
294
295 if (lpcf->Flags & CF_FIXEDPITCHONLY)
296 if (!(lplf->lfPitchAndFamily & FIXED_PITCH))
297 return 1;
298 if (lpcf->Flags & CF_ANSIONLY)
299 if (lplf->lfCharSet != ANSI_CHARSET)
300 return 1;
301 if (lpcf->Flags & CF_TTONLY)
302 if (!(nFontType & TRUETYPE_FONTTYPE))
303 return 1;
304
305 i=SendMessageA(hwnd, CB_ADDSTRING, 0, (LPARAM)lplf->lfFaceName);
306 if (i!=CB_ERR)
307 {
308 w=(lplf->lfCharSet << 8) | lplf->lfPitchAndFamily;
309 SendMessageA(hwnd, CB_SETITEMDATA, i, MAKELONG(nFontType,w));
310 return 1 ; /* store some important font information */
311 }
312 else
313 return 0;
314}
315
316typedef struct
317{
318 HWND hWnd1;
319 HWND hWnd2;
320 LPCHOOSEFONTA lpcf32a;
321} CFn_ENUMSTRUCT, *LPCFn_ENUMSTRUCT;
322
323/*************************************************************************
324 * FontFamilyEnumProc32 [internal]
325 */
326static INT WINAPI FontFamilyEnumProc(LPENUMLOGFONTA lpEnumLogFont,
327 LPNEWTEXTMETRICA metrics, UINT nFontType, LPARAM lParam)
328{
329 LPCFn_ENUMSTRUCT e;
330 e=(LPCFn_ENUMSTRUCT)lParam;
331 return AddFontFamily(&lpEnumLogFont->elfLogFont, nFontType, e->lpcf32a, e->hWnd1);
332}
333
334#ifndef __WIN32OS2__
335/***********************************************************************
336 * FontFamilyEnumProc16 (COMMDLG.19)
337 */
338INT16 WINAPI FontFamilyEnumProc16( SEGPTR logfont, SEGPTR metrics,
339 UINT16 nFontType, LPARAM lParam )
340{
341 HWND16 hwnd=LOWORD(lParam);
342 HWND hDlg=GetParent(hwnd);
343 LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
344 LOGFONT16 *lplf = (LOGFONT16 *)PTR_SEG_TO_LIN( logfont );
345 LOGFONTA lf32a;
346 FONT_LogFont16To32A(lplf, &lf32a);
347 return AddFontFamily(&lf32a, nFontType, (LPCHOOSEFONTA)lpcf->lpTemplateName,
348 hwnd);
349}
350#endif //!__WIN32OS2__
351
352/*************************************************************************
353 * SetFontStylesToCombo2 [internal]
354 *
355 * Fill font style information into combobox (without using font.c directly)
356 */
357static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, LPLOGFONTA lplf)
358{
359 #define FSTYLES 4
360 struct FONTSTYLE
361 { int italic;
362 int weight;
363 char stname[20]; };
364 static struct FONTSTYLE fontstyles[FSTYLES]={
365 { 0,FW_NORMAL,"Regular"},{0,FW_BOLD,"Bold"},
366 { 1,FW_NORMAL,"Italic"}, {1,FW_BOLD,"Bold Italic"}};
367 HFONT hf;
368 TEXTMETRICA tm;
369 int i,j;
370
371 for (i=0;i<FSTYLES;i++)
372 {
373 lplf->lfItalic=fontstyles[i].italic;
374 lplf->lfWeight=fontstyles[i].weight;
375 hf=CreateFontIndirectA(lplf);
376 hf=SelectObject(hdc,hf);
377 GetTextMetricsA(hdc,&tm);
378 hf=SelectObject(hdc,hf);
379 DeleteObject(hf);
380
381 if (tm.tmWeight==fontstyles[i].weight &&
382 tm.tmItalic==fontstyles[i].italic) /* font successful created ? */
383 {
384#ifdef __WIN32OS2__
385 char *str = fontstyles[i].stname;
386 j=SendMessageA(hwnd,CB_ADDSTRING,0,(LPARAM)str );
387 if (j==CB_ERR) return 1;
388 j=SendMessageA(hwnd, CB_SETITEMDATA, j,
389 MAKELONG(fontstyles[i].weight,fontstyles[i].italic));
390#else
391 char *str = SEGPTR_STRDUP(fontstyles[i].stname);
392 j=SendMessage16(hwnd,CB_ADDSTRING16,0,(LPARAM)SEGPTR_GET(str) );
393 SEGPTR_FREE(str);
394 if (j==CB_ERR) return 1;
395 j=SendMessage16(hwnd, CB_SETITEMDATA16, j,
396 MAKELONG(fontstyles[i].weight,fontstyles[i].italic));
397#endif
398 if (j==CB_ERR) return 1;
399 }
400 }
401 return 0;
402}
403
404/*************************************************************************
405 * AddFontSizeToCombo3 [internal]
406 */
407static int AddFontSizeToCombo3(HWND hwnd, UINT h, LPCHOOSEFONTA lpcf)
408{
409 int j;
410 char buffer[20];
411
412 if ( (!(lpcf->Flags & CF_LIMITSIZE)) ||
413 ((lpcf->Flags & CF_LIMITSIZE) && (h >= lpcf->nSizeMin) && (h <= lpcf->nSizeMax)))
414 {
415 sprintf(buffer, "%2d", h);
416 j=SendMessageA(hwnd, CB_FINDSTRINGEXACT, -1, (LPARAM)buffer);
417 if (j==CB_ERR)
418 {
419 j=SendMessageA(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer);
420 if (j!=CB_ERR) j = SendMessageA(hwnd, CB_SETITEMDATA, j, h);
421 if (j==CB_ERR) return 1;
422 }
423 }
424 return 0;
425}
426
427/*************************************************************************
428 * SetFontSizesToCombo3 [internal]
429 */
430static int SetFontSizesToCombo3(HWND hwnd, LPCHOOSEFONTA lpcf)
431{
432 static const int sizes[]={8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72,0};
433 int i;
434
435 for (i=0; sizes[i]; i++)
436 if (AddFontSizeToCombo3(hwnd, sizes[i], lpcf)) return 1;
437 return 0;
438}
439
440/***********************************************************************
441 * AddFontStyle [internal]
442 */
443static INT AddFontStyle(LPLOGFONTA lplf, UINT nFontType,
444 LPCHOOSEFONTA lpcf, HWND hcmb2, HWND hcmb3, HWND hDlg)
445{
446 int i;
447
448 TRACE("(nFontType=%d)\n",nFontType);
449 TRACE(" %s h=%ld w=%ld e=%ld o=%ld wg=%ld i=%d u=%d s=%d"
450 " ch=%d op=%d cp=%d q=%d pf=%xh\n",
451 lplf->lfFaceName,lplf->lfHeight,lplf->lfWidth,
452 lplf->lfEscapement,lplf->lfOrientation,
453 lplf->lfWeight,lplf->lfItalic,lplf->lfUnderline,
454 lplf->lfStrikeOut,lplf->lfCharSet, lplf->lfOutPrecision,
455 lplf->lfClipPrecision,lplf->lfQuality, lplf->lfPitchAndFamily);
456 if (nFontType & RASTER_FONTTYPE)
457 {
458 if (AddFontSizeToCombo3(hcmb3, lplf->lfHeight, lpcf)) return 0;
459 } else if (SetFontSizesToCombo3(hcmb3, lpcf)) return 0;
460
461 if (!SendMessageA(hcmb2, CB_GETCOUNT, 0, 0))
462 {
463 HDC hdc= (lpcf->Flags & CF_PRINTERFONTS && lpcf->hDC) ? lpcf->hDC : GetDC(hDlg);
464 i=SetFontStylesToCombo2(hcmb2,hdc,lplf);
465 if (!(lpcf->Flags & CF_PRINTERFONTS && lpcf->hDC))
466 ReleaseDC(hDlg,hdc);
467 if (i)
468 return 0;
469 }
470 return 1 ;
471
472}
473
474#ifndef __WIN32OS2__
475/***********************************************************************
476 * FontStyleEnumProc16 (COMMDLG.18)
477 */
478INT16 WINAPI FontStyleEnumProc16( SEGPTR logfont, SEGPTR metrics,
479 UINT16 nFontType, LPARAM lParam )
480{
481 HWND16 hcmb2=LOWORD(lParam);
482 HWND16 hcmb3=HIWORD(lParam);
483 HWND hDlg=GetParent(hcmb3);
484 LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
485 LOGFONT16 *lplf = (LOGFONT16 *)PTR_SEG_TO_LIN(logfont);
486 LOGFONTA lf32a;
487 FONT_LogFont16To32A(lplf, &lf32a);
488 return AddFontStyle(&lf32a, nFontType, (LPCHOOSEFONTA)lpcf->lpTemplateName,
489 hcmb2, hcmb3, hDlg);
490}
491#endif //!__WIN32OS2__
492
493/***********************************************************************
494 * FontStyleEnumProc32 [internal]
495 */
496static INT WINAPI FontStyleEnumProc( LPENUMLOGFONTA lpFont,
497 LPNEWTEXTMETRICA metrics, UINT nFontType, LPARAM lParam )
498{
499 LPCFn_ENUMSTRUCT s=(LPCFn_ENUMSTRUCT)lParam;
500 HWND hcmb2=s->hWnd1;
501 HWND hcmb3=s->hWnd2;
502 HWND hDlg=GetParent(hcmb3);
503 return AddFontStyle(&lpFont->elfLogFont, nFontType, s->lpcf32a, hcmb2,
504 hcmb3, hDlg);
505}
506
507/***********************************************************************
508 * CFn_WMInitDialog [internal]
509 */
510static LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
511 LPCHOOSEFONTA lpcf)
512{
513 HDC hdc;
514 int i,j,res,init=0;
515 long l;
516 LPLOGFONTA lpxx;
517 HCURSOR hcursor=SetCursor(LoadCursorA(0,IDC_WAITA));
518
519 SetWindowLongA(hDlg, DWL_USER, lParam);
520 lpxx=lpcf->lpLogFont;
521 TRACE("WM_INITDIALOG lParam=%08lX\n", lParam);
522
523 if (lpcf->lStructSize != sizeof(CHOOSEFONTA))
524 {
525 ERR("structure size failure !!!\n");
526 EndDialog (hDlg, 0);
527 return FALSE;
528 }
529 if (!hBitmapTT)
530 hBitmapTT = LoadBitmapA(0, MAKEINTRESOURCEA(OBM_TRTYPE));
531
532 /* This font will be deleted by WM_COMMAND */
533 SendDlgItemMessageA(hDlg,stc6,WM_SETFONT,
534 CreateFontA(0, 0, 1, 1, 400, 0, 0, 0, 0, 0, 0, 0, 0, NULL),FALSE);
535
536 if (!(lpcf->Flags & CF_SHOWHELP) || !IsWindow(lpcf->hwndOwner))
537 ShowWindow(GetDlgItem(hDlg,pshHelp),SW_HIDE);
538 if (!(lpcf->Flags & CF_APPLY))
539 ShowWindow(GetDlgItem(hDlg,psh3),SW_HIDE);
540 if (lpcf->Flags & CF_EFFECTS)
541 {
542 for (res=1,i=0;res && i<TEXT_COLORS;i++)
543 {
544 /* FIXME: load color name from resource: res=LoadString(...,i+....,buffer,.....); */
545 char name[20];
546 strcpy( name, "[color name]" );
547 j=SendDlgItemMessageA(hDlg, cmb4, CB_ADDSTRING, 0, (LPARAM)name);
548#ifdef __WIN32OS2__
549 SendDlgItemMessageA(hDlg, cmb4, CB_SETITEMDATA, j, textcolors[j]);
550#else
551 SendDlgItemMessageA(hDlg, cmb4, CB_SETITEMDATA16, j, textcolors[j]);
552#endif
553 /* look for a fitting value in color combobox */
554 if (textcolors[j]==lpcf->rgbColors)
555 SendDlgItemMessageA(hDlg,cmb4, CB_SETCURSEL,j,0);
556 }
557 }
558 else
559 {
560 ShowWindow(GetDlgItem(hDlg,cmb4),SW_HIDE);
561 ShowWindow(GetDlgItem(hDlg,chx1),SW_HIDE);
562 ShowWindow(GetDlgItem(hDlg,chx2),SW_HIDE);
563 ShowWindow(GetDlgItem(hDlg,grp1),SW_HIDE);
564 ShowWindow(GetDlgItem(hDlg,stc4),SW_HIDE);
565 }
566 hdc= (lpcf->Flags & CF_PRINTERFONTS && lpcf->hDC) ? lpcf->hDC : GetDC(hDlg);
567 if (hdc)
568 {
569 CFn_ENUMSTRUCT s;
570 s.hWnd1=GetDlgItem(hDlg,cmb1);
571 s.lpcf32a=lpcf;
572 if (!EnumFontFamiliesA(hdc, NULL, FontFamilyEnumProc, (LPARAM)&s))
573 TRACE("EnumFontFamilies returns 0\n");
574 if (lpcf->Flags & CF_INITTOLOGFONTSTRUCT)
575 {
576 /* look for fitting font name in combobox1 */
577 j=SendDlgItemMessageA(hDlg,cmb1,CB_FINDSTRING,-1,(LONG)lpxx->lfFaceName);
578 if (j!=CB_ERR)
579 {
580 SendDlgItemMessageA(hDlg, cmb1, CB_SETCURSEL, j, 0);
581 SendMessageA(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
582 GetDlgItem(hDlg,cmb1));
583 init=1;
584 /* look for fitting font style in combobox2 */
585 l=MAKELONG(lpxx->lfWeight > FW_MEDIUM ? FW_BOLD:FW_NORMAL,lpxx->lfItalic !=0);
586 for (i=0;i<TEXT_EXTRAS;i++)
587 {
588 if (l==SendDlgItemMessageA(hDlg, cmb2, CB_GETITEMDATA, i, 0))
589 SendDlgItemMessageA(hDlg, cmb2, CB_SETCURSEL, i, 0);
590 }
591
592 /* look for fitting font size in combobox3 */
593 j=SendDlgItemMessageA(hDlg, cmb3, CB_GETCOUNT, 0, 0);
594 for (i=0;i<j;i++)
595 {
596 if (lpxx->lfHeight==(int)SendDlgItemMessageA(hDlg,cmb3, CB_GETITEMDATA,i,0))
597 SendDlgItemMessageA(hDlg,cmb3,CB_SETCURSEL,i,0);
598 }
599 }
600 }
601 if (!init)
602 {
603 SendDlgItemMessageA(hDlg,cmb1,CB_SETCURSEL,0,0);
604 SendMessageA(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE),
605 GetDlgItem(hDlg,cmb1));
606 }
607 if (lpcf->Flags & CF_USESTYLE && lpcf->lpszStyle)
608 {
609 j=SendDlgItemMessageA(hDlg,cmb2,CB_FINDSTRING,-1,(LONG)lpcf->lpszStyle);
610 if (j!=CB_ERR)
611 {
612 j=SendDlgItemMessageA(hDlg,cmb2,CB_SETCURSEL,j,0);
613 SendMessageA(hDlg,WM_COMMAND,cmb2,
614 MAKELONG(GetDlgItem(hDlg,cmb2),CBN_SELCHANGE));
615 }
616 }
617 }
618 else
619 {
620 WARN("HDC failure !!!\n");
621 EndDialog (hDlg, 0);
622 return FALSE;
623 }
624
625 if (!(lpcf->Flags & CF_PRINTERFONTS && lpcf->hDC))
626 ReleaseDC(hDlg,hdc);
627 SetCursor(hcursor);
628 return TRUE;
629}
630
631
632/***********************************************************************
633 * CFn_WMMeasureItem [internal]
634 */
635static LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
636{
637 BITMAP bm;
638 LPMEASUREITEMSTRUCT lpmi=(LPMEASUREITEMSTRUCT)lParam;
639 if (!hBitmapTT)
640 hBitmapTT = LoadBitmapA(0, MAKEINTRESOURCEA(OBM_TRTYPE));
641 GetObjectA( hBitmapTT, sizeof(bm), &bm );
642 lpmi->itemHeight=bm.bmHeight;
643 /* FIXME: use MAX of bm.bmHeight and tm.tmHeight .*/
644 return 0;
645}
646
647
648/***********************************************************************
649 * CFn_WMDrawItem [internal]
650 */
651static LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
652{
653 HBRUSH hBrush;
654 char buffer[40];
655 BITMAP bm;
656 COLORREF cr, oldText=0, oldBk=0;
657 RECT rect;
658#if 0
659 HDC hMemDC;
660 int nFontType;
661 HBITMAP hBitmap; /* for later TT usage */
662#endif
663 LPDRAWITEMSTRUCT lpdi = (LPDRAWITEMSTRUCT)lParam;
664
665 if (lpdi->itemID == 0xFFFF) /* got no items */
666 DrawFocusRect(lpdi->hDC, &lpdi->rcItem);
667 else
668 {
669 if (lpdi->CtlType == ODT_COMBOBOX)
670 {
671 if (lpdi->itemState ==ODS_SELECTED)
672 {
673 hBrush=GetSysColorBrush(COLOR_HIGHLIGHT);
674 oldText=SetTextColor(lpdi->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
675 oldBk=SetBkColor(lpdi->hDC, GetSysColor(COLOR_HIGHLIGHT));
676 } else
677 {
678 hBrush = SelectObject(lpdi->hDC, GetStockObject(LTGRAY_BRUSH));
679 SelectObject(lpdi->hDC, hBrush);
680 }
681 FillRect(lpdi->hDC, &lpdi->rcItem, hBrush);
682 }
683 else
684 return TRUE; /* this should never happen */
685
686 rect=lpdi->rcItem;
687 switch (lpdi->CtlID)
688 {
689 case cmb1: /* TRACE(commdlg,"WM_Drawitem cmb1\n"); */
690 SendMessageA(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
691 (LPARAM)buffer);
692 GetObjectA( hBitmapTT, sizeof(bm), &bm );
693 TextOutA(lpdi->hDC, lpdi->rcItem.left + bm.bmWidth + 10,
694 lpdi->rcItem.top, buffer, strlen(buffer));
695#if 0
696 nFontType = SendMessageA(lpdi->hwndItem, CB_GETITEMDATA, lpdi->itemID,0L);
697 /* FIXME: draw bitmap if truetype usage */
698 if (nFontType&TRUETYPE_FONTTYPE)
699 {
700 hMemDC = CreateCompatibleDC(lpdi->hDC);
701 hBitmap = SelectObject(hMemDC, hBitmapTT);
702 BitBlt(lpdi->hDC, lpdi->rcItem.left, lpdi->rcItem.top,
703 bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
704 SelectObject(hMemDC, hBitmap);
705 DeleteDC(hMemDC);
706 }
707#endif
708 break;
709 case cmb2:
710 case cmb3: /* TRACE(commdlg,"WM_DRAWITEN cmb2,cmb3\n"); */
711 SendMessageA(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
712 (LPARAM)buffer);
713 TextOutA(lpdi->hDC, lpdi->rcItem.left,
714 lpdi->rcItem.top, buffer, strlen(buffer));
715 break;
716
717 case cmb4: /* TRACE(commdlg,"WM_DRAWITEM cmb4 (=COLOR)\n"); */
718 SendMessageA(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
719 (LPARAM)buffer);
720 TextOutA(lpdi->hDC, lpdi->rcItem.left + 25+5,
721 lpdi->rcItem.top, buffer, strlen(buffer));
722 cr = SendMessageA(lpdi->hwndItem, CB_GETITEMDATA, lpdi->itemID,0L);
723 hBrush = CreateSolidBrush(cr);
724 if (hBrush)
725 {
726 hBrush = SelectObject (lpdi->hDC, hBrush) ;
727 rect.right=rect.left+25;
728 rect.top++;
729 rect.left+=5;
730 rect.bottom--;
731 Rectangle( lpdi->hDC, rect.left, rect.top,
732 rect.right, rect.bottom );
733 DeleteObject( SelectObject (lpdi->hDC, hBrush)) ;
734 }
735 rect=lpdi->rcItem;
736 rect.left+=25+5;
737 break;
738
739 default: return TRUE; /* this should never happen */
740 }
741 if (lpdi->itemState == ODS_SELECTED)
742 {
743 SetTextColor(lpdi->hDC, oldText);
744 SetBkColor(lpdi->hDC, oldBk);
745 }
746 }
747 return TRUE;
748}
749
750/***********************************************************************
751 * CFn_WMCtlColor [internal]
752 */
753static LRESULT CFn_WMCtlColorStatic(HWND hDlg, WPARAM wParam, LPARAM lParam,
754 LPCHOOSEFONTA lpcf)
755{
756 if (lpcf->Flags & CF_EFFECTS)
757 if (GetDlgCtrlID(lParam)==stc6)
758 {
759 SetTextColor((HDC)wParam, lpcf->rgbColors);
760 return GetStockObject(WHITE_BRUSH);
761 }
762 return 0;
763}
764
765/***********************************************************************
766 * CFn_WMCommand [internal]
767 */
768static LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam,
769 LPCHOOSEFONTA lpcf)
770{
771 HFONT hFont;
772 int i,j;
773 long l;
774 HDC hdc;
775 LPLOGFONTA lpxx=lpcf->lpLogFont;
776
777 TRACE("WM_COMMAND wParam=%08lX lParam=%08lX\n", (LONG)wParam, lParam);
778 switch (LOWORD(wParam))
779 {
780 case cmb1:if (HIWORD(wParam)==CBN_SELCHANGE)
781 {
782 hdc=(lpcf->Flags & CF_PRINTERFONTS && lpcf->hDC) ? lpcf->hDC : GetDC(hDlg);
783 if (hdc)
784 {
785#ifdef __WIN32OS2__
786 SendDlgItemMessageA(hDlg, cmb2, CB_RESETCONTENT, 0, 0);
787 SendDlgItemMessageA(hDlg, cmb3, CB_RESETCONTENT, 0, 0);
788 i=SendDlgItemMessageA(hDlg, cmb1, CB_GETCURSEL, 0, 0);
789#else
790 SendDlgItemMessageA(hDlg, cmb2, CB_RESETCONTENT16, 0, 0);
791 SendDlgItemMessageA(hDlg, cmb3, CB_RESETCONTENT16, 0, 0);
792 i=SendDlgItemMessageA(hDlg, cmb1, CB_GETCURSEL16, 0, 0);
793#endif
794 if (i!=CB_ERR)
795 {
796 HCURSOR hcursor=SetCursor(LoadCursorA(0,IDC_WAITA));
797 CFn_ENUMSTRUCT s;
798 char str[256];
799 SendDlgItemMessageA(hDlg, cmb1, CB_GETLBTEXT, i,
800 (LPARAM)str);
801 TRACE("WM_COMMAND/cmb1 =>%s\n",str);
802 s.hWnd1=GetDlgItem(hDlg, cmb2);
803 s.hWnd2=GetDlgItem(hDlg, cmb3);
804 s.lpcf32a=lpcf;
805 EnumFontFamiliesA(hdc, str, FontStyleEnumProc, (LPARAM)&s);
806 SetCursor(hcursor);
807 }
808 if (!(lpcf->Flags & CF_PRINTERFONTS && lpcf->hDC))
809 ReleaseDC(hDlg,hdc);
810 }
811 else
812 {
813 WARN("HDC failure !!!\n");
814 EndDialog (hDlg, 0);
815 return TRUE;
816 }
817 }
818 case chx1:
819 case chx2:
820 case cmb2:
821 case cmb3:if (HIWORD(wParam)==CBN_SELCHANGE || HIWORD(wParam)== BN_CLICKED )
822 {
823 char str[256];
824 TRACE("WM_COMMAND/cmb2,3 =%08lX\n", lParam);
825 i=SendDlgItemMessageA(hDlg,cmb1,CB_GETCURSEL,0,0);
826 if (i==CB_ERR)
827 i=GetDlgItemTextA( hDlg, cmb1, str, 256 );
828 else
829 {
830 SendDlgItemMessageA(hDlg,cmb1,CB_GETLBTEXT,i,
831 (LPARAM)str);
832 l=SendDlgItemMessageA(hDlg,cmb1,CB_GETITEMDATA,i,0);
833 j=HIWORD(l);
834 lpcf->nFontType = LOWORD(l);
835 /* FIXME: lpcf->nFontType |= .... SIMULATED_FONTTYPE and so */
836 /* same value reported to the EnumFonts
837 call back with the extra FONTTYPE_... bits added */
838 lpxx->lfPitchAndFamily=j&0xff;
839 lpxx->lfCharSet=j>>8;
840 }
841 strcpy(lpxx->lfFaceName,str);
842 i=SendDlgItemMessageA(hDlg, cmb2, CB_GETCURSEL, 0, 0);
843 if (i!=CB_ERR)
844 {
845 l=SendDlgItemMessageA(hDlg, cmb2, CB_GETITEMDATA, i, 0);
846 if (0!=(lpxx->lfItalic=HIWORD(l)))
847 lpcf->nFontType |= ITALIC_FONTTYPE;
848 if ((lpxx->lfWeight=LOWORD(l)) > FW_MEDIUM)
849 lpcf->nFontType |= BOLD_FONTTYPE;
850 }
851 i=SendDlgItemMessageA(hDlg, cmb3, CB_GETCURSEL, 0, 0);
852 if (i!=CB_ERR)
853 lpxx->lfHeight=-LOWORD(SendDlgItemMessageA(hDlg, cmb3, CB_GETITEMDATA, i, 0));
854 else
855 lpxx->lfHeight=0;
856 lpxx->lfStrikeOut=IsDlgButtonChecked(hDlg,chx1);
857 lpxx->lfUnderline=IsDlgButtonChecked(hDlg,chx2);
858 lpxx->lfWidth=lpxx->lfOrientation=lpxx->lfEscapement=0;
859 lpxx->lfOutPrecision=OUT_DEFAULT_PRECIS;
860 lpxx->lfClipPrecision=CLIP_DEFAULT_PRECIS;
861 lpxx->lfQuality=DEFAULT_QUALITY;
862 lpcf->iPointSize= -10*lpxx->lfHeight;
863
864 hFont=CreateFontIndirectA(lpxx);
865 if (hFont)
866 {
867 HFONT oldFont=SendDlgItemMessageA(hDlg, stc6,
868 WM_GETFONT, 0, 0);
869 SendDlgItemMessageA(hDlg,stc6,WM_SETFONT,hFont,TRUE);
870 DeleteObject(oldFont);
871 }
872 }
873 break;
874
875 case cmb4:i=SendDlgItemMessageA(hDlg, cmb4, CB_GETCURSEL, 0, 0);
876 if (i!=CB_ERR)
877 {
878 lpcf->rgbColors=textcolors[i];
879 InvalidateRect( GetDlgItem(hDlg,stc6), NULL, 0 );
880 }
881 break;
882
883 case psh15:i=RegisterWindowMessageA( HELPMSGSTRING );
884 if (lpcf->hwndOwner)
885 SendMessageA(lpcf->hwndOwner, i, 0, (LPARAM)GetWindowLongA(hDlg, DWL_USER));
886/* if (CFn_HookCallChk(lpcf))
887 CallWindowProc16(lpcf->lpfnHook,hDlg,WM_COMMAND,psh15,(LPARAM)lpcf);*/
888 break;
889
890 case IDOK:if ( (!(lpcf->Flags & CF_LIMITSIZE)) ||
891 ( (lpcf->Flags & CF_LIMITSIZE) &&
892 (-lpxx->lfHeight >= lpcf->nSizeMin) &&
893 (-lpxx->lfHeight <= lpcf->nSizeMax)))
894 EndDialog(hDlg, TRUE);
895 else
896 {
897 char buffer[80];
898 sprintf(buffer,"Select a font size between %d and %d points.",
899 lpcf->nSizeMin,lpcf->nSizeMax);
900 MessageBoxA(hDlg, buffer, NULL, MB_OK);
901 }
902 return(TRUE);
903 case IDCANCEL:EndDialog(hDlg, FALSE);
904 return(TRUE);
905 }
906 return(FALSE);
907}
908
909static LRESULT CFn_WMDestroy(HWND hwnd, WPARAM wParam, LPARAM lParam)
910{
911 DeleteObject(SendDlgItemMessageA(hwnd, stc6, WM_GETFONT, 0, 0));
912 return TRUE;
913}
914
915#ifndef __WIN32OS2__
916/***********************************************************************
917 * FormatCharDlgProc16 (COMMDLG.16)
918 FIXME: 1. some strings are "hardcoded", but it's better load from sysres
919 2. some CF_.. flags are not supported
920 3. some TType extensions
921 */
922LRESULT WINAPI FormatCharDlgProc16(HWND16 hDlg, UINT16 message, WPARAM16 wParam,
923 LPARAM lParam)
924{
925 LPCHOOSEFONT16 lpcf;
926 LPCHOOSEFONTA lpcf32a;
927 UINT uMsg32;
928 WPARAM wParam32;
929 LRESULT res=0;
930 if (message!=WM_INITDIALOG)
931 {
932 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER);
933 if (!lpcf)
934 return FALSE;
935 if (CFn_HookCallChk(lpcf))
936 res=CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg,message,wParam,lParam);
937 if (res)
938 return res;
939 }
940 else
941 {
942 lpcf=(LPCHOOSEFONT16)lParam;
943 lpcf32a=(LPCHOOSEFONTA)lpcf->lpTemplateName;
944 if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf32a))
945 {
946 TRACE("CFn_WMInitDialog returned FALSE\n");
947 return FALSE;
948 }
949 if (CFn_HookCallChk(lpcf))
950 return CallWindowProc16((WNDPROC16)lpcf->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
951 }
952 WINPROC_MapMsg16To32A(message, wParam, &uMsg32, &wParam32, &lParam);
953 lpcf32a=(LPCHOOSEFONTA)lpcf->lpTemplateName;
954 switch (uMsg32)
955 {
956 case WM_MEASUREITEM:
957 res=CFn_WMMeasureItem(hDlg, wParam32, lParam);
958 break;
959 case WM_DRAWITEM:
960 res=CFn_WMDrawItem(hDlg, wParam32, lParam);
961 break;
962 case WM_CTLCOLORSTATIC:
963 res=CFn_WMCtlColorStatic(hDlg, wParam32, lParam, lpcf32a);
964 break;
965 case WM_COMMAND:
966 res=CFn_WMCommand(hDlg, wParam32, lParam, lpcf32a);
967 break;
968 case WM_DESTROY:
969 res=CFn_WMDestroy(hDlg, wParam32, lParam);
970 break;
971 case WM_CHOOSEFONT_GETLOGFONT:
972 TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n",
973 lParam);
974 FIXME("current logfont back to caller\n");
975 break;
976 }
977 WINPROC_UnmapMsg16To32A(hDlg,uMsg32, wParam32, lParam, res);
978 return res;
979}
980#endif //!__WIN32OS2__
981
982/***********************************************************************
983 * FormatCharDlgProcA [internal]
984 */
985LRESULT WINAPI FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam,
986 LPARAM lParam)
987{
988 LPCHOOSEFONTA lpcf;
989 LRESULT res=FALSE;
990 if (uMsg!=WM_INITDIALOG)
991 {
992 lpcf=(LPCHOOSEFONTA)GetWindowLongA(hDlg, DWL_USER);
993 if (!lpcf)
994 return FALSE;
995 if (CFn_HookCallChk32(lpcf))
996 res=CallWindowProcA((WNDPROC)lpcf->lpfnHook, hDlg, uMsg, wParam, lParam);
997 if (res)
998 return res;
999 }
1000 else
1001 {
1002 lpcf=(LPCHOOSEFONTA)lParam;
1003 if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf))
1004 {
1005 TRACE("CFn_WMInitDialog returned FALSE\n");
1006 return FALSE;
1007 }
1008 if (CFn_HookCallChk32(lpcf))
1009 return CallWindowProcA((WNDPROC)lpcf->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
1010 }
1011 switch (uMsg)
1012 {
1013 case WM_MEASUREITEM:
1014 return CFn_WMMeasureItem(hDlg, wParam, lParam);
1015 case WM_DRAWITEM:
1016 return CFn_WMDrawItem(hDlg, wParam, lParam);
1017 case WM_CTLCOLORSTATIC:
1018 return CFn_WMCtlColorStatic(hDlg, wParam, lParam, lpcf);
1019 case WM_COMMAND:
1020 return CFn_WMCommand(hDlg, wParam, lParam, lpcf);
1021 case WM_DESTROY:
1022 return CFn_WMDestroy(hDlg, wParam, lParam);
1023 case WM_CHOOSEFONT_GETLOGFONT:
1024 TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n",
1025 lParam);
1026 FIXME("current logfont back to caller\n");
1027 break;
1028 }
1029 return res;
1030}
1031
1032/***********************************************************************
1033 * FormatCharDlgProcW [internal]
1034 */
1035LRESULT WINAPI FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
1036 LPARAM lParam)
1037{
1038 LPCHOOSEFONTW lpcf32w;
1039 LPCHOOSEFONTA lpcf32a;
1040 LRESULT res=FALSE;
1041 if (uMsg!=WM_INITDIALOG)
1042 {
1043 lpcf32w=(LPCHOOSEFONTW)GetWindowLongA(hDlg, DWL_USER);
1044 if (!lpcf32w)
1045 return FALSE;
1046 if (CFn_HookCallChk32((LPCHOOSEFONTA)lpcf32w))
1047 res=CallWindowProcW((WNDPROC)lpcf32w->lpfnHook, hDlg, uMsg, wParam, lParam);
1048 if (res)
1049 return res;
1050 }
1051 else
1052 {
1053 lpcf32w=(LPCHOOSEFONTW)lParam;
1054 lpcf32a=(LPCHOOSEFONTA)lpcf32w->lpTemplateName;
1055 if (!CFn_WMInitDialog(hDlg, wParam, lParam, lpcf32a))
1056 {
1057 TRACE("CFn_WMInitDialog returned FALSE\n");
1058 return FALSE;
1059 }
1060 if (CFn_HookCallChk32((LPCHOOSEFONTA)lpcf32w))
1061 return CallWindowProcW((WNDPROC)lpcf32w->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
1062 }
1063 lpcf32a=(LPCHOOSEFONTA)lpcf32w->lpTemplateName;
1064 switch (uMsg)
1065 {
1066 case WM_MEASUREITEM:
1067 return CFn_WMMeasureItem(hDlg, wParam, lParam);
1068 case WM_DRAWITEM:
1069 return CFn_WMDrawItem(hDlg, wParam, lParam);
1070 case WM_CTLCOLORSTATIC:
1071 return CFn_WMCtlColorStatic(hDlg, wParam, lParam, lpcf32a);
1072 case WM_COMMAND:
1073 return CFn_WMCommand(hDlg, wParam, lParam, lpcf32a);
1074 case WM_DESTROY:
1075 return CFn_WMDestroy(hDlg, wParam, lParam);
1076 case WM_CHOOSEFONT_GETLOGFONT:
1077 TRACE("WM_CHOOSEFONT_GETLOGFONT lParam=%08lX\n",
1078 lParam);
1079 FIXME("current logfont back to caller\n");
1080 break;
1081 }
1082 return res;
1083}
1084
1085
Note: See TracBrowser for help on using the repository browser.