Changed Adam Sacarny's email, and -debugmsg to --debugmsg.
[wine/gsoc_dplay.git] / dlls / commdlg / printdlg16.c
blob8f9b70be5baab85f1d2c38bc0c683d391c8eddb7
1 /*
2 * COMMDLG - Print Dialog
4 * Copyright 1994 Martin Ayotte
5 * Copyright 1996 Albrecht Kleine
6 * Copyright 1999 Klaas van Gend
7 * Copyright 2000 Huw D M Davies
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <ctype.h>
25 #include <stdlib.h>
26 #include <stdarg.h>
27 #include <stdio.h>
28 #include <string.h>
30 #define NONAMELESSUNION
31 #define NONAMELESSSTRUCT
32 #include "windef.h"
33 #include "winbase.h"
34 #include "wingdi.h"
35 #include "wine/wingdi16.h"
36 #include "winuser.h"
37 #include "wine/winuser16.h"
38 #include "commdlg.h"
39 #include "dlgs.h"
40 #include "wine/debug.h"
41 #include "cderr.h"
42 #include "winspool.h"
43 #include "winerror.h"
45 WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
47 #include "cdlg.h"
48 #include "printdlg.h"
50 static BOOL PRINTDLG_CreateDevNames16(HGLOBAL16 *hmem, char* DeviceDriverName,
51 char* DeviceName, char* OutputPort)
53 long size;
54 char* pDevNamesSpace;
55 char* pTempPtr;
56 LPDEVNAMES lpDevNames;
57 char buf[260];
59 size = strlen(DeviceDriverName) + 1
60 + strlen(DeviceName) + 1
61 + strlen(OutputPort) + 1
62 + sizeof(DEVNAMES);
64 if(*hmem)
65 *hmem = GlobalReAlloc16(*hmem, size, GMEM_MOVEABLE);
66 else
67 *hmem = GlobalAlloc16(GMEM_MOVEABLE, size);
68 if (*hmem == 0)
69 return FALSE;
71 pDevNamesSpace = GlobalLock16(*hmem);
72 lpDevNames = (LPDEVNAMES) pDevNamesSpace;
74 pTempPtr = pDevNamesSpace + sizeof(DEVNAMES);
75 strcpy(pTempPtr, DeviceDriverName);
76 lpDevNames->wDriverOffset = pTempPtr - pDevNamesSpace;
78 pTempPtr += strlen(DeviceDriverName) + 1;
79 strcpy(pTempPtr, DeviceName);
80 lpDevNames->wDeviceOffset = pTempPtr - pDevNamesSpace;
82 pTempPtr += strlen(DeviceName) + 1;
83 strcpy(pTempPtr, OutputPort);
84 lpDevNames->wOutputOffset = pTempPtr - pDevNamesSpace;
86 PRINTDLG_GetDefaultPrinterNameA(buf, sizeof(buf));
87 lpDevNames->wDefault = (strcmp(buf, DeviceName) == 0) ? 1 : 0;
88 GlobalUnlock16(*hmem);
89 return TRUE;
93 /***********************************************************************
94 * PRINTDLG_WMInitDialog [internal]
96 static LRESULT PRINTDLG_WMInitDialog16(HWND hDlg, WPARAM wParam,
97 PRINT_PTRA* PrintStructures)
99 LPPRINTDLG16 lppd = PrintStructures->dlg.lpPrintDlg16;
100 DEVNAMES *pdn;
101 DEVMODEA *pdm;
102 char *name = NULL;
103 UINT comboID = (lppd->Flags & PD_PRINTSETUP) ? cmb1 : cmb4;
105 /* load Collate ICONs */
106 PrintStructures->hCollateIcon =
107 LoadIconA(COMDLG32_hInstance, "PD32_COLLATE");
108 PrintStructures->hNoCollateIcon =
109 LoadIconA(COMDLG32_hInstance, "PD32_NOCOLLATE");
110 if(PrintStructures->hCollateIcon == 0 ||
111 PrintStructures->hNoCollateIcon == 0) {
112 ERR("no icon in resourcefile\n");
113 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
114 EndDialog(hDlg, FALSE);
117 /* load Paper Orientation ICON */
118 /* FIXME: not implemented yet */
121 * if lppd->Flags PD_SHOWHELP is specified, a HELPMESGSTRING message
122 * must be registered and the Help button must be shown.
124 if (lppd->Flags & PD_SHOWHELP) {
125 if((PrintStructures->HelpMessageID =
126 RegisterWindowMessageA(HELPMSGSTRINGA)) == 0) {
127 COMDLG32_SetCommDlgExtendedError(CDERR_REGISTERMSGFAIL);
128 return FALSE;
130 } else
131 PrintStructures->HelpMessageID = 0;
133 if (!(lppd->Flags & PD_PRINTSETUP)) {
134 /* We have a print quality combo box. What shall we do? */
135 if (GetDlgItem(hDlg,cmb1)) {
136 char buf [20];
138 FIXME("Print quality only displaying currently.\n");
140 pdm = GlobalLock16(lppd->hDevMode);
141 if(pdm) {
142 switch (pdm->dmPrintQuality) {
143 case DMRES_HIGH : strcpy(buf,"High");break;
144 case DMRES_MEDIUM : strcpy(buf,"Medium");break;
145 case DMRES_LOW : strcpy(buf,"Low");break;
146 case DMRES_DRAFT : strcpy(buf,"Draft");break;
147 case 0 : strcpy(buf,"Default");break;
148 default : sprintf(buf,"%ddpi",pdm->dmPrintQuality);break;
150 GlobalUnlock16(lppd->hDevMode);
151 } else
152 strcpy(buf,"Default");
153 SendDlgItemMessageA(hDlg,cmb1,CB_ADDSTRING,0,(LPARAM)buf);
154 SendDlgItemMessageA(hDlg,cmb1,CB_SETCURSEL,0,0);
155 EnableWindow(GetDlgItem(hDlg,cmb1),FALSE);
159 /* FIXME: I allow more freedom than either Win95 or WinNT,
160 * which do not agree to what errors should be thrown or not
161 * in case nToPage or nFromPage is out-of-range.
163 if (lppd->nMaxPage < lppd->nMinPage)
164 lppd->nMaxPage = lppd->nMinPage;
165 if (lppd->nMinPage == lppd->nMaxPage)
166 lppd->Flags |= PD_NOPAGENUMS;
167 if (lppd->nToPage < lppd->nMinPage)
168 lppd->nToPage = lppd->nMinPage;
169 if (lppd->nToPage > lppd->nMaxPage)
170 lppd->nToPage = lppd->nMaxPage;
171 if (lppd->nFromPage < lppd->nMinPage)
172 lppd->nFromPage = lppd->nMinPage;
173 if (lppd->nFromPage > lppd->nMaxPage)
174 lppd->nFromPage = lppd->nMaxPage;
176 /* If the printer combo box is in the dialog, fill it */
177 if (GetDlgItem(hDlg,comboID)) {
178 /* Fill Combobox
180 pdn = GlobalLock16(lppd->hDevNames);
181 pdm = GlobalLock16(lppd->hDevMode);
182 if(pdn)
183 name = (char*)pdn + pdn->wDeviceOffset;
184 else if(pdm)
185 name = pdm->dmDeviceName;
186 PRINTDLG_SetUpPrinterListComboA(hDlg, comboID, name);
187 if(pdm) GlobalUnlock16(lppd->hDevMode);
188 if(pdn) GlobalUnlock16(lppd->hDevNames);
190 /* Now find selected printer and update rest of dlg */
191 name = HeapAlloc(GetProcessHeap(),0,256);
192 if (GetDlgItemTextA(hDlg, comboID, name, 255))
193 PRINTDLG_ChangePrinterA(hDlg, name, PrintStructures);
194 } else {
195 /* else just use default printer */
196 char name[200];
197 BOOL ret = PRINTDLG_GetDefaultPrinterNameA(name, sizeof(name));
199 if (ret)
200 PRINTDLG_ChangePrinterA(hDlg, name, PrintStructures);
201 else
202 FIXME("No default printer found, expect problems!\n");
204 HeapFree(GetProcessHeap(),0,name);
206 return TRUE;
209 /************************************************************
211 * PRINTDLG_Get16TemplateFrom32 [Internal]
212 * Generates a 16 bits template from the Wine 32 bits resource
215 static HGLOBAL16 PRINTDLG_Get16TemplateFrom32(LPCSTR PrintResourceName)
217 HRSRC hResInfo;
218 HGLOBAL hDlgTmpl32;
219 LPCVOID template32;
220 DWORD size;
221 HGLOBAL16 hGlobal16;
222 LPVOID template;
224 if (!(hResInfo = FindResourceA(COMDLG32_hInstance,
225 PrintResourceName, (LPSTR)RT_DIALOG)))
227 COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
228 return 0;
230 if (!(hDlgTmpl32 = LoadResource(COMDLG32_hInstance, hResInfo )) ||
231 !(template32 = LockResource( hDlgTmpl32 )))
233 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
234 return 0;
236 size = SizeofResource(COMDLG32_hInstance, hResInfo);
237 hGlobal16 = GlobalAlloc16(0, size);
238 if (!hGlobal16)
240 COMDLG32_SetCommDlgExtendedError(CDERR_MEMALLOCFAILURE);
241 ERR("alloc failure for %ld bytes\n", size);
242 return 0;
244 template = GlobalLock16(hGlobal16);
245 if (!template)
247 COMDLG32_SetCommDlgExtendedError(CDERR_MEMLOCKFAILURE);
248 ERR("global lock failure for %x handle\n", hGlobal16);
249 GlobalFree16(hGlobal16);
250 return 0;
252 ConvertDialog32To16((LPVOID)template32, size, (LPVOID)template);
253 GlobalUnlock16(hGlobal16);
254 return hGlobal16;
257 static BOOL PRINTDLG_CreateDC16(LPPRINTDLG16 lppd)
259 DEVNAMES *pdn = GlobalLock16(lppd->hDevNames);
260 DEVMODEA *pdm = GlobalLock16(lppd->hDevMode);
262 if(lppd->Flags & PD_RETURNDC) {
263 lppd->hDC = HDC_16(CreateDCA((char*)pdn + pdn->wDriverOffset,
264 (char*)pdn + pdn->wDeviceOffset,
265 (char*)pdn + pdn->wOutputOffset,
266 pdm ));
267 } else if(lppd->Flags & PD_RETURNIC) {
268 lppd->hDC = HDC_16(CreateICA((char*)pdn + pdn->wDriverOffset,
269 (char*)pdn + pdn->wDeviceOffset,
270 (char*)pdn + pdn->wOutputOffset,
271 pdm ));
273 GlobalUnlock16(lppd->hDevNames);
274 GlobalUnlock16(lppd->hDevMode);
275 return lppd->hDC ? TRUE : FALSE;
278 /************************************************************
280 * PRINTDLG_GetDlgTemplate
283 static HGLOBAL16 PRINTDLG_GetDlgTemplate16(PRINTDLG16 *lppd)
285 HGLOBAL16 hDlgTmpl, hResInfo;
287 if (lppd->Flags & PD_PRINTSETUP) {
288 if(lppd->Flags & PD_ENABLESETUPTEMPLATEHANDLE) {
289 hDlgTmpl = lppd->hSetupTemplate;
290 } else if(lppd->Flags & PD_ENABLESETUPTEMPLATE) {
291 hResInfo = FindResource16(lppd->hInstance,
292 MapSL(lppd->lpSetupTemplateName), (LPSTR)RT_DIALOG);
293 hDlgTmpl = LoadResource16(lppd->hInstance, hResInfo);
294 } else {
295 hDlgTmpl = PRINTDLG_Get16TemplateFrom32("PRINT32_SETUP");
297 } else {
298 if(lppd->Flags & PD_ENABLEPRINTTEMPLATEHANDLE) {
299 hDlgTmpl = lppd->hPrintTemplate;
300 } else if(lppd->Flags & PD_ENABLEPRINTTEMPLATE) {
301 hResInfo = FindResource16(lppd->hInstance,
302 MapSL(lppd->lpPrintTemplateName),
303 (LPSTR)RT_DIALOG);
304 hDlgTmpl = LoadResource16(lppd->hInstance, hResInfo);
305 } else {
306 hDlgTmpl = PRINTDLG_Get16TemplateFrom32("PRINT32");
309 return hDlgTmpl;
312 /***********************************************************************
313 * PrintDlg (COMMDLG.20)
315 * Displays the the PRINT dialog box, which enables the user to specify
316 * specific properties of the print job.
318 * RETURNS
319 * nonzero if the user pressed the OK button
320 * zero if the user cancelled the window or an error occurred
322 * BUGS
323 * * calls up to the 32-bit versions of the Dialogs, which look different
324 * * Customizing is *not* implemented.
327 BOOL16 WINAPI PrintDlg16(
328 LPPRINTDLG16 lppd /* [in/out] ptr to PRINTDLG struct */
330 BOOL bRet = FALSE;
331 LPVOID ptr;
332 HINSTANCE16 hInst = GetWindowWord( HWND_32(lppd->hwndOwner), GWL_HINSTANCE );
334 if(TRACE_ON(commdlg)) {
335 char flagstr[1000] = "";
336 struct pd_flags *pflag = pd_flags;
337 for( ; pflag->name; pflag++) {
338 if(lppd->Flags & pflag->flag)
339 strcat(flagstr, pflag->name);
341 TRACE("(%p): hwndOwner = %08x, hDevMode = %08x, hDevNames = %08x\n"
342 "pp. %d-%d, min p %d, max p %d, copies %d, hinst %08x\n"
343 "flags %08lx (%s)\n",
344 lppd, lppd->hwndOwner, lppd->hDevMode, lppd->hDevNames,
345 lppd->nFromPage, lppd->nToPage, lppd->nMinPage, lppd->nMaxPage,
346 lppd->nCopies, lppd->hInstance, lppd->Flags, flagstr);
349 if(lppd->lStructSize != sizeof(PRINTDLG16)) {
350 ERR("structure size (%ld/%d)\n",lppd->lStructSize,sizeof(PRINTDLG16));
351 COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE);
352 return FALSE;
355 if(lppd->Flags & PD_RETURNDEFAULT) {
356 PRINTER_INFO_2A *pbuf;
357 DRIVER_INFO_3A *dbuf;
358 HANDLE hprn;
359 DWORD needed;
361 if(lppd->hDevMode || lppd->hDevNames) {
362 WARN("hDevMode or hDevNames non-zero for PD_RETURNDEFAULT\n");
363 COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE);
364 return FALSE;
366 if(!PRINTDLG_OpenDefaultPrinter(&hprn)) {
367 WARN("Can't find default printer\n");
368 COMDLG32_SetCommDlgExtendedError(PDERR_NODEFAULTPRN);
369 return FALSE;
372 GetPrinterA(hprn, 2, NULL, 0, &needed);
373 pbuf = HeapAlloc(GetProcessHeap(), 0, needed);
374 GetPrinterA(hprn, 2, (LPBYTE)pbuf, needed, &needed);
375 GetPrinterDriverA(hprn, NULL, 3, NULL, 0, &needed);
376 dbuf = HeapAlloc(GetProcessHeap(),0,needed);
377 if (!GetPrinterDriverA(hprn, NULL, 3, (LPBYTE)dbuf, needed, &needed)) {
378 ERR("GetPrinterDriverA failed for %s, le %ld, fix your config!\n",
379 pbuf->pPrinterName,GetLastError());
380 HeapFree(GetProcessHeap(), 0, dbuf);
381 COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE);
382 return FALSE;
384 ClosePrinter(hprn);
385 PRINTDLG_CreateDevNames16(&(lppd->hDevNames),
386 dbuf->pDriverPath,
387 pbuf->pPrinterName,
388 pbuf->pPortName);
389 lppd->hDevMode = GlobalAlloc16(GMEM_MOVEABLE,pbuf->pDevMode->dmSize+
390 pbuf->pDevMode->dmDriverExtra);
391 ptr = GlobalLock16(lppd->hDevMode);
392 memcpy(ptr, pbuf->pDevMode, pbuf->pDevMode->dmSize +
393 pbuf->pDevMode->dmDriverExtra);
394 GlobalUnlock16(lppd->hDevMode);
395 HeapFree(GetProcessHeap(), 0, pbuf);
396 HeapFree(GetProcessHeap(), 0, dbuf);
397 bRet = TRUE;
398 } else {
399 HGLOBAL16 hDlgTmpl;
400 PRINT_PTRA *PrintStructures;
402 /* load Dialog resources,
403 * depending on Flags indicates Print32 or Print32_setup dialog
405 hDlgTmpl = PRINTDLG_GetDlgTemplate16(lppd);
406 if (!hDlgTmpl) {
407 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
408 return FALSE;
410 PrintStructures = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
411 sizeof(PRINT_PTRA));
412 PrintStructures->dlg.lpPrintDlg16 = lppd;
413 PrintStructures->dlg.lpPrintDlg = (LPPRINTDLGA)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(PRINTDLGA));
414 #define CVAL(x) PrintStructures->dlg.lpPrintDlg->x = lppd->x;
415 #define MVAL(x) PrintStructures->dlg.lpPrintDlg->x = MapSL(lppd->x);
416 CVAL(Flags);
417 PrintStructures->dlg.lpPrintDlg->hwndOwner = HWND_32(lppd->hwndOwner);
418 PrintStructures->dlg.lpPrintDlg->hDC = HDC_32(lppd->hDC);
419 CVAL(nFromPage);CVAL(nToPage);CVAL(nMinPage);CVAL(nMaxPage);
420 CVAL(nCopies);
421 PrintStructures->dlg.lpPrintDlg->hInstance = HINSTANCE_32(lppd->hInstance);
422 CVAL(lCustData);
423 MVAL(lpPrintTemplateName);MVAL(lpSetupTemplateName);
424 /* Don't copy rest, it is 16 bit specific */
425 #undef MVAL
426 #undef CVAL
428 PrintStructures->lpDevMode = HeapAlloc(GetProcessHeap(),0,sizeof(DEVMODEA));
430 /* and create & process the dialog .
431 * -1 is failure, 0 is broken hwnd, everything else is ok.
433 bRet = (0<DialogBoxIndirectParam16(
434 hInst, hDlgTmpl, lppd->hwndOwner,
435 (DLGPROC16)GetProcAddress16(GetModuleHandle16("COMMDLG"),(LPCSTR)21),
436 (LPARAM)PrintStructures
439 if (!PrintStructures->lpPrinterInfo) bRet = FALSE;
440 if(bRet) {
441 DEVMODEA *lpdm = PrintStructures->lpDevMode, *lpdmReturn;
442 PRINTER_INFO_2A *pi = PrintStructures->lpPrinterInfo;
443 DRIVER_INFO_3A *di = PrintStructures->lpDriverInfo;
445 if (lppd->hDevMode == 0) {
446 TRACE(" No hDevMode yet... Need to create my own\n");
447 lppd->hDevMode = GlobalAlloc16(GMEM_MOVEABLE,
448 lpdm->dmSize + lpdm->dmDriverExtra);
449 } else {
450 WORD locks;
451 if((locks = (GlobalFlags16(lppd->hDevMode)&GMEM_LOCKCOUNT))) {
452 WARN("hDevMode has %d locks on it. Unlocking it now\n", locks);
453 while(locks--) {
454 GlobalUnlock16(lppd->hDevMode);
455 TRACE("Now got %d locks\n", locks);
458 lppd->hDevMode = GlobalReAlloc16(lppd->hDevMode,
459 lpdm->dmSize + lpdm->dmDriverExtra,
460 GMEM_MOVEABLE);
462 lpdmReturn = GlobalLock16(lppd->hDevMode);
463 memcpy(lpdmReturn, lpdm, lpdm->dmSize + lpdm->dmDriverExtra);
465 if (lppd->hDevNames != 0) {
466 WORD locks;
467 if((locks = (GlobalFlags16(lppd->hDevNames)&GMEM_LOCKCOUNT))) {
468 WARN("hDevNames has %d locks on it. Unlocking it now\n", locks);
469 while(locks--)
470 GlobalUnlock16(lppd->hDevNames);
473 PRINTDLG_CreateDevNames16(&(lppd->hDevNames),
474 di->pDriverPath,
475 pi->pPrinterName,
476 pi->pPortName
478 GlobalUnlock16(lppd->hDevMode);
480 if (!(lppd->Flags & (PD_ENABLESETUPTEMPLATEHANDLE | PD_ENABLESETUPTEMPLATE)))
481 GlobalFree16(hDlgTmpl); /* created from the 32 bits resource */
482 HeapFree(GetProcessHeap(), 0, PrintStructures->lpDevMode);
483 HeapFree(GetProcessHeap(), 0, PrintStructures->lpPrinterInfo);
484 HeapFree(GetProcessHeap(), 0, PrintStructures->lpDriverInfo);
485 HeapFree(GetProcessHeap(), 0, PrintStructures);
487 if(bRet && (lppd->Flags & PD_RETURNDC || lppd->Flags & PD_RETURNIC))
488 bRet = PRINTDLG_CreateDC16(lppd);
490 TRACE("exit! (%d)\n", bRet);
491 return bRet;
494 /**********************************************************************
496 * 16 bit commdlg
499 /***********************************************************************
500 * PrintDlgProc (COMMDLG.21)
502 BOOL16 CALLBACK PrintDlgProc16(HWND16 hDlg16, UINT16 uMsg, WPARAM16 wParam,
503 LPARAM lParam)
505 HWND hDlg = HWND_32(hDlg16);
506 PRINT_PTRA* PrintStructures;
507 BOOL16 res = FALSE;
509 if (uMsg!=WM_INITDIALOG) {
510 PrintStructures = (PRINT_PTRA*)GetPropA(hDlg,"__WINE_PRINTDLGDATA");
511 if (!PrintStructures)
512 return FALSE;
513 } else {
514 PrintStructures = (PRINT_PTRA*) lParam;
515 SetPropA(hDlg,"__WINE_PRINTDLGDATA",PrintStructures);
516 res = PRINTDLG_WMInitDialog16(hDlg, wParam, PrintStructures);
518 if(PrintStructures->dlg.lpPrintDlg16->Flags & PD_ENABLEPRINTHOOK) {
519 res = CallWindowProc16(
520 (WNDPROC16)PrintStructures->dlg.lpPrintDlg16->lpfnPrintHook,
521 hDlg16, uMsg, wParam, (LPARAM)PrintStructures->dlg.lpPrintDlg16
524 return res;
527 if(PrintStructures->dlg.lpPrintDlg16->Flags & PD_ENABLEPRINTHOOK) {
528 res = CallWindowProc16(
529 (WNDPROC16)PrintStructures->dlg.lpPrintDlg16->lpfnPrintHook,
530 hDlg16,uMsg, wParam, lParam
532 if(LOWORD(res)) return res;
535 switch (uMsg) {
536 case WM_COMMAND: {
537 /* We need to map those for the 32bit window procedure, compare
538 * with 32Ato16 mapper in winproc.c
540 return PRINTDLG_WMCommandA(
541 hDlg,
542 MAKEWPARAM(wParam,HIWORD(lParam)),
543 LOWORD(lParam),
544 PrintStructures
547 case WM_DESTROY:
548 DestroyIcon(PrintStructures->hCollateIcon);
549 DestroyIcon(PrintStructures->hNoCollateIcon);
550 /* FIXME: don't forget to delete the paper orientation icons here! */
552 return FALSE;
554 return res;
557 /***********************************************************************
558 * PrintSetupDlgProc (COMMDLG.22)
560 BOOL16 CALLBACK PrintSetupDlgProc16(HWND16 hWnd16, UINT16 wMsg, WPARAM16 wParam,
561 LPARAM lParam)
563 HWND hWnd = HWND_32(hWnd16);
564 switch (wMsg)
566 case WM_INITDIALOG:
567 TRACE("WM_INITDIALOG lParam=%08lX\n", lParam);
568 ShowWindow(hWnd, SW_SHOWNORMAL);
569 return (TRUE);
570 case WM_COMMAND:
571 switch (wParam) {
572 case IDOK:
573 EndDialog(hWnd, TRUE);
574 return(TRUE);
575 case IDCANCEL:
576 EndDialog(hWnd, FALSE);
577 return(TRUE);
579 return(FALSE);
581 return FALSE;