Split Win16/32 printer dialogs.
[wine/wine64.git] / dlls / commdlg / printdlg16.c
blob5cbf394b444c0a9861a0bac5ad9b2385509d16e6
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 <stdio.h>
27 #include <string.h>
29 #define NONAMELESSUNION
30 #define NONAMELESSSTRUCT
31 #include "windef.h"
32 #include "winbase.h"
33 #include "wingdi.h"
34 #include "wine/wingdi16.h"
35 #include "winuser.h"
36 #include "wine/winuser16.h"
37 #include "commdlg.h"
38 #include "dlgs.h"
39 #include "wine/debug.h"
40 #include "cderr.h"
41 #include "winspool.h"
42 #include "winerror.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
46 #include "cdlg.h"
47 #include "printdlg.h"
49 static BOOL PRINTDLG_CreateDevNames16(HGLOBAL16 *hmem, char* DeviceDriverName,
50 char* DeviceName, char* OutputPort)
52 long size;
53 char* pDevNamesSpace;
54 char* pTempPtr;
55 LPDEVNAMES lpDevNames;
56 char buf[260];
58 size = strlen(DeviceDriverName) + 1
59 + strlen(DeviceName) + 1
60 + strlen(OutputPort) + 1
61 + sizeof(DEVNAMES);
63 if(*hmem)
64 *hmem = GlobalReAlloc16(*hmem, size, GMEM_MOVEABLE);
65 else
66 *hmem = GlobalAlloc16(GMEM_MOVEABLE, size);
67 if (*hmem == 0)
68 return FALSE;
70 pDevNamesSpace = GlobalLock16(*hmem);
71 lpDevNames = (LPDEVNAMES) pDevNamesSpace;
73 pTempPtr = pDevNamesSpace + sizeof(DEVNAMES);
74 strcpy(pTempPtr, DeviceDriverName);
75 lpDevNames->wDriverOffset = pTempPtr - pDevNamesSpace;
77 pTempPtr += strlen(DeviceDriverName) + 1;
78 strcpy(pTempPtr, DeviceName);
79 lpDevNames->wDeviceOffset = pTempPtr - pDevNamesSpace;
81 pTempPtr += strlen(DeviceName) + 1;
82 strcpy(pTempPtr, OutputPort);
83 lpDevNames->wOutputOffset = pTempPtr - pDevNamesSpace;
85 PRINTDLG_GetDefaultPrinterNameA(buf, sizeof(buf));
86 lpDevNames->wDefault = (strcmp(buf, DeviceName) == 0) ? 1 : 0;
87 GlobalUnlock16(*hmem);
88 return TRUE;
92 /***********************************************************************
93 * PRINTDLG_WMInitDialog [internal]
95 static LRESULT PRINTDLG_WMInitDialog16(HWND hDlg, WPARAM wParam,
96 PRINT_PTRA* PrintStructures)
98 LPPRINTDLG16 lppd = PrintStructures->dlg.lpPrintDlg16;
99 DEVNAMES *pdn;
100 DEVMODEA *pdm;
101 char *name = NULL;
102 UINT comboID = (lppd->Flags & PD_PRINTSETUP) ? cmb1 : cmb4;
104 /* load Collate ICONs */
105 PrintStructures->hCollateIcon =
106 LoadIconA(COMDLG32_hInstance, "PD32_COLLATE");
107 PrintStructures->hNoCollateIcon =
108 LoadIconA(COMDLG32_hInstance, "PD32_NOCOLLATE");
109 if(PrintStructures->hCollateIcon == 0 ||
110 PrintStructures->hNoCollateIcon == 0) {
111 ERR("no icon in resourcefile\n");
112 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
113 EndDialog(hDlg, FALSE);
116 /* load Paper Orientation ICON */
117 /* FIXME: not implemented yet */
120 * if lppd->Flags PD_SHOWHELP is specified, a HELPMESGSTRING message
121 * must be registered and the Help button must be shown.
123 if (lppd->Flags & PD_SHOWHELP) {
124 if((PrintStructures->HelpMessageID =
125 RegisterWindowMessageA(HELPMSGSTRINGA)) == 0) {
126 COMDLG32_SetCommDlgExtendedError(CDERR_REGISTERMSGFAIL);
127 return FALSE;
129 } else
130 PrintStructures->HelpMessageID = 0;
132 if (!(lppd->Flags & PD_PRINTSETUP)) {
133 /* We have a print quality combo box. What shall we do? */
134 if (GetDlgItem(hDlg,cmb1)) {
135 char buf [20];
137 FIXME("Print quality only displaying currently.\n");
139 pdm = GlobalLock16(lppd->hDevMode);
140 if(pdm) {
141 switch (pdm->dmPrintQuality) {
142 case DMRES_HIGH : strcpy(buf,"High");break;
143 case DMRES_MEDIUM : strcpy(buf,"Medium");break;
144 case DMRES_LOW : strcpy(buf,"Low");break;
145 case DMRES_DRAFT : strcpy(buf,"Draft");break;
146 case 0 : strcpy(buf,"Default");break;
147 default : sprintf(buf,"%ddpi",pdm->dmPrintQuality);break;
149 GlobalUnlock16(lppd->hDevMode);
150 } else
151 strcpy(buf,"Default");
152 SendDlgItemMessageA(hDlg,cmb1,CB_ADDSTRING,0,(LPARAM)buf);
153 SendDlgItemMessageA(hDlg,cmb1,CB_SETCURSEL,0,0);
154 EnableWindow(GetDlgItem(hDlg,cmb1),FALSE);
158 /* FIXME: I allow more freedom than either Win95 or WinNT,
159 * which do not agree to what errors should be thrown or not
160 * in case nToPage or nFromPage is out-of-range.
162 if (lppd->nMaxPage < lppd->nMinPage)
163 lppd->nMaxPage = lppd->nMinPage;
164 if (lppd->nMinPage == lppd->nMaxPage)
165 lppd->Flags |= PD_NOPAGENUMS;
166 if (lppd->nToPage < lppd->nMinPage)
167 lppd->nToPage = lppd->nMinPage;
168 if (lppd->nToPage > lppd->nMaxPage)
169 lppd->nToPage = lppd->nMaxPage;
170 if (lppd->nFromPage < lppd->nMinPage)
171 lppd->nFromPage = lppd->nMinPage;
172 if (lppd->nFromPage > lppd->nMaxPage)
173 lppd->nFromPage = lppd->nMaxPage;
175 /* If the printer combo box is in the dialog, fill it */
176 if (GetDlgItem(hDlg,comboID)) {
177 /* Fill Combobox
179 pdn = GlobalLock16(lppd->hDevNames);
180 pdm = GlobalLock16(lppd->hDevMode);
181 if(pdn)
182 name = (char*)pdn + pdn->wDeviceOffset;
183 else if(pdm)
184 name = pdm->dmDeviceName;
185 PRINTDLG_SetUpPrinterListComboA(hDlg, comboID, name);
186 if(pdm) GlobalUnlock16(lppd->hDevMode);
187 if(pdn) GlobalUnlock16(lppd->hDevNames);
189 /* Now find selected printer and update rest of dlg */
190 name = HeapAlloc(GetProcessHeap(),0,256);
191 if (GetDlgItemTextA(hDlg, comboID, name, 255))
192 PRINTDLG_ChangePrinterA(hDlg, name, PrintStructures);
193 } else {
194 /* else just use default printer */
195 char name[200];
196 BOOL ret = PRINTDLG_GetDefaultPrinterNameA(name, sizeof(name));
198 if (ret)
199 PRINTDLG_ChangePrinterA(hDlg, name, PrintStructures);
200 else
201 FIXME("No default printer found, expect problems!\n");
203 HeapFree(GetProcessHeap(),0,name);
205 return TRUE;
208 /************************************************************
210 * PRINTDLG_Get16TemplateFrom32 [Internal]
211 * Generates a 16 bits template from the Wine 32 bits resource
214 static HGLOBAL16 PRINTDLG_Get16TemplateFrom32(char *PrintResourceName)
216 HRSRC hResInfo;
217 HGLOBAL hDlgTmpl32;
218 LPCVOID template32;
219 DWORD size;
220 HGLOBAL16 hGlobal16;
221 LPVOID template;
223 if (!(hResInfo = FindResourceA(COMDLG32_hInstance,
224 PrintResourceName, RT_DIALOGA)))
226 COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
227 return 0;
229 if (!(hDlgTmpl32 = LoadResource(COMDLG32_hInstance, hResInfo )) ||
230 !(template32 = LockResource( hDlgTmpl32 )))
232 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
233 return 0;
235 size = SizeofResource(COMDLG32_hInstance, hResInfo);
236 hGlobal16 = GlobalAlloc16(0, size);
237 if (!hGlobal16)
239 COMDLG32_SetCommDlgExtendedError(CDERR_MEMALLOCFAILURE);
240 ERR("alloc failure for %ld bytes\n", size);
241 return 0;
243 template = GlobalLock16(hGlobal16);
244 if (!template)
246 COMDLG32_SetCommDlgExtendedError(CDERR_MEMLOCKFAILURE);
247 ERR("global lock failure for %x handle\n", hGlobal16);
248 GlobalFree16(hGlobal16);
249 return 0;
251 ConvertDialog32To16((LPVOID)template32, size, (LPVOID)template);
252 GlobalUnlock16(hGlobal16);
253 return hGlobal16;
256 static BOOL PRINTDLG_CreateDC16(LPPRINTDLG16 lppd)
258 DEVNAMES *pdn = GlobalLock16(lppd->hDevNames);
259 DEVMODEA *pdm = GlobalLock16(lppd->hDevMode);
261 if(lppd->Flags & PD_RETURNDC) {
262 lppd->hDC = HDC_16(CreateDCA((char*)pdn + pdn->wDriverOffset,
263 (char*)pdn + pdn->wDeviceOffset,
264 (char*)pdn + pdn->wOutputOffset,
265 pdm ));
266 } else if(lppd->Flags & PD_RETURNIC) {
267 lppd->hDC = HDC_16(CreateICA((char*)pdn + pdn->wDriverOffset,
268 (char*)pdn + pdn->wDeviceOffset,
269 (char*)pdn + pdn->wOutputOffset,
270 pdm ));
272 GlobalUnlock16(lppd->hDevNames);
273 GlobalUnlock16(lppd->hDevMode);
274 return lppd->hDC ? TRUE : FALSE;
277 /************************************************************
279 * PRINTDLG_GetDlgTemplate
282 static HGLOBAL16 PRINTDLG_GetDlgTemplate16(PRINTDLG16 *lppd)
284 HGLOBAL16 hDlgTmpl, hResInfo;
286 if (lppd->Flags & PD_PRINTSETUP) {
287 if(lppd->Flags & PD_ENABLESETUPTEMPLATEHANDLE) {
288 hDlgTmpl = lppd->hSetupTemplate;
289 } else if(lppd->Flags & PD_ENABLESETUPTEMPLATE) {
290 hResInfo = FindResource16(lppd->hInstance,
291 MapSL(lppd->lpSetupTemplateName), RT_DIALOGA);
292 hDlgTmpl = LoadResource16(lppd->hInstance, hResInfo);
293 } else {
294 hDlgTmpl = PRINTDLG_Get16TemplateFrom32("PRINT32_SETUP");
296 } else {
297 if(lppd->Flags & PD_ENABLEPRINTTEMPLATEHANDLE) {
298 hDlgTmpl = lppd->hPrintTemplate;
299 } else if(lppd->Flags & PD_ENABLEPRINTTEMPLATE) {
300 hResInfo = FindResource16(lppd->hInstance,
301 MapSL(lppd->lpPrintTemplateName),
302 RT_DIALOGA);
303 hDlgTmpl = LoadResource16(lppd->hInstance, hResInfo);
304 } else {
305 hDlgTmpl = PRINTDLG_Get16TemplateFrom32("PRINT32");
308 return hDlgTmpl;
311 /***********************************************************************
312 * PrintDlg (COMMDLG.20)
314 * Displays the the PRINT dialog box, which enables the user to specify
315 * specific properties of the print job.
317 * RETURNS
318 * nonzero if the user pressed the OK button
319 * zero if the user cancelled the window or an error occurred
321 * BUGS
322 * * calls up to the 32-bit versions of the Dialogs, which look different
323 * * Customizing is *not* implemented.
326 BOOL16 WINAPI PrintDlg16(
327 LPPRINTDLG16 lppd /* [in/out] ptr to PRINTDLG struct */
329 BOOL bRet = FALSE;
330 LPVOID ptr;
331 HINSTANCE16 hInst = GetWindowWord( HWND_32(lppd->hwndOwner), GWL_HINSTANCE );
333 if(TRACE_ON(commdlg)) {
334 char flagstr[1000] = "";
335 struct pd_flags *pflag = pd_flags;
336 for( ; pflag->name; pflag++) {
337 if(lppd->Flags & pflag->flag)
338 strcat(flagstr, pflag->name);
340 TRACE("(%p): hwndOwner = %08x, hDevMode = %08x, hDevNames = %08x\n"
341 "pp. %d-%d, min p %d, max p %d, copies %d, hinst %08x\n"
342 "flags %08lx (%s)\n",
343 lppd, lppd->hwndOwner, lppd->hDevMode, lppd->hDevNames,
344 lppd->nFromPage, lppd->nToPage, lppd->nMinPage, lppd->nMaxPage,
345 lppd->nCopies, lppd->hInstance, lppd->Flags, flagstr);
348 if(lppd->lStructSize != sizeof(PRINTDLG16)) {
349 ERR("structure size (%ld/%d)\n",lppd->lStructSize,sizeof(PRINTDLG16));
350 COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE);
351 return FALSE;
354 if(lppd->Flags & PD_RETURNDEFAULT) {
355 PRINTER_INFO_2A *pbuf;
356 DRIVER_INFO_3A *dbuf;
357 HANDLE hprn;
358 DWORD needed;
360 if(lppd->hDevMode || lppd->hDevNames) {
361 WARN("hDevMode or hDevNames non-zero for PD_RETURNDEFAULT\n");
362 COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE);
363 return FALSE;
365 if(!PRINTDLG_OpenDefaultPrinter(&hprn)) {
366 WARN("Can't find default printer\n");
367 COMDLG32_SetCommDlgExtendedError(PDERR_NODEFAULTPRN);
368 return FALSE;
371 GetPrinterA(hprn, 2, NULL, 0, &needed);
372 pbuf = HeapAlloc(GetProcessHeap(), 0, needed);
373 GetPrinterA(hprn, 2, (LPBYTE)pbuf, needed, &needed);
374 GetPrinterDriverA(hprn, NULL, 3, NULL, 0, &needed);
375 dbuf = HeapAlloc(GetProcessHeap(),0,needed);
376 if (!GetPrinterDriverA(hprn, NULL, 3, (LPBYTE)dbuf, needed, &needed)) {
377 ERR("GetPrinterDriverA failed for %s, le %ld, fix your config!\n",
378 pbuf->pPrinterName,GetLastError());
379 COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE);
380 return FALSE;
382 ClosePrinter(hprn);
383 PRINTDLG_CreateDevNames16(&(lppd->hDevNames),
384 dbuf->pDriverPath,
385 pbuf->pPrinterName,
386 pbuf->pPortName);
387 lppd->hDevMode = GlobalAlloc16(GMEM_MOVEABLE,pbuf->pDevMode->dmSize+
388 pbuf->pDevMode->dmDriverExtra);
389 ptr = GlobalLock16(lppd->hDevMode);
390 memcpy(ptr, pbuf->pDevMode, pbuf->pDevMode->dmSize +
391 pbuf->pDevMode->dmDriverExtra);
392 GlobalUnlock16(lppd->hDevMode);
393 HeapFree(GetProcessHeap(), 0, pbuf);
394 HeapFree(GetProcessHeap(), 0, dbuf);
395 bRet = TRUE;
396 } else {
397 HGLOBAL16 hDlgTmpl;
398 PRINT_PTRA *PrintStructures;
400 /* load Dialog resources,
401 * depending on Flags indicates Print32 or Print32_setup dialog
403 hDlgTmpl = PRINTDLG_GetDlgTemplate16(lppd);
404 if (!hDlgTmpl) {
405 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
406 return FALSE;
408 PrintStructures = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
409 sizeof(PRINT_PTRA));
410 PrintStructures->dlg.lpPrintDlg16 = lppd;
411 PrintStructures->dlg.lpPrintDlg = (LPPRINTDLGA)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(PRINTDLGA));
412 #define CVAL(x) PrintStructures->dlg.lpPrintDlg->x = lppd->x;
413 #define MVAL(x) PrintStructures->dlg.lpPrintDlg->x = MapSL(lppd->x);
414 CVAL(Flags);
415 PrintStructures->dlg.lpPrintDlg->hwndOwner = HWND_32(lppd->hwndOwner);
416 PrintStructures->dlg.lpPrintDlg->hDC = HDC_32(lppd->hDC);
417 CVAL(nFromPage);CVAL(nToPage);CVAL(nMinPage);CVAL(nMaxPage);
418 CVAL(nCopies);
419 PrintStructures->dlg.lpPrintDlg->hInstance = HINSTANCE_32(lppd->hInstance);
420 CVAL(lCustData);
421 MVAL(lpPrintTemplateName);MVAL(lpSetupTemplateName);
422 /* Don't copy rest, it is 16 bit specific */
423 #undef MVAL
424 #undef CVAL
426 PrintStructures->lpDevMode = HeapAlloc(GetProcessHeap(),0,sizeof(DEVMODEA));
428 /* and create & process the dialog .
429 * -1 is failure, 0 is broken hwnd, everything else is ok.
431 bRet = (0<DialogBoxIndirectParam16(
432 hInst, hDlgTmpl, lppd->hwndOwner,
433 (DLGPROC16)GetProcAddress16(GetModuleHandle16("COMMDLG"),(LPCSTR)21),
434 (LPARAM)PrintStructures
437 if (!PrintStructures->lpPrinterInfo) bRet = FALSE;
438 if(bRet) {
439 DEVMODEA *lpdm = PrintStructures->lpDevMode, *lpdmReturn;
440 PRINTER_INFO_2A *pi = PrintStructures->lpPrinterInfo;
441 DRIVER_INFO_3A *di = PrintStructures->lpDriverInfo;
443 if (lppd->hDevMode == 0) {
444 TRACE(" No hDevMode yet... Need to create my own\n");
445 lppd->hDevMode = GlobalAlloc16(GMEM_MOVEABLE,
446 lpdm->dmSize + lpdm->dmDriverExtra);
447 } else {
448 WORD locks;
449 if((locks = (GlobalFlags16(lppd->hDevMode)&GMEM_LOCKCOUNT))) {
450 WARN("hDevMode has %d locks on it. Unlocking it now\n", locks);
451 while(locks--) {
452 GlobalUnlock16(lppd->hDevMode);
453 TRACE("Now got %d locks\n", locks);
456 lppd->hDevMode = GlobalReAlloc16(lppd->hDevMode,
457 lpdm->dmSize + lpdm->dmDriverExtra,
458 GMEM_MOVEABLE);
460 lpdmReturn = GlobalLock16(lppd->hDevMode);
461 memcpy(lpdmReturn, lpdm, lpdm->dmSize + lpdm->dmDriverExtra);
463 if (lppd->hDevNames != 0) {
464 WORD locks;
465 if((locks = (GlobalFlags16(lppd->hDevNames)&GMEM_LOCKCOUNT))) {
466 WARN("hDevNames has %d locks on it. Unlocking it now\n", locks);
467 while(locks--)
468 GlobalUnlock16(lppd->hDevNames);
471 PRINTDLG_CreateDevNames16(&(lppd->hDevNames),
472 di->pDriverPath,
473 pi->pPrinterName,
474 pi->pPortName
476 GlobalUnlock16(lppd->hDevMode);
478 if (!(lppd->Flags & (PD_ENABLESETUPTEMPLATEHANDLE | PD_ENABLESETUPTEMPLATE)))
479 GlobalFree16(hDlgTmpl); /* created from the 32 bits resource */
480 HeapFree(GetProcessHeap(), 0, PrintStructures->lpDevMode);
481 HeapFree(GetProcessHeap(), 0, PrintStructures->lpPrinterInfo);
482 HeapFree(GetProcessHeap(), 0, PrintStructures->lpDriverInfo);
483 HeapFree(GetProcessHeap(), 0, PrintStructures);
485 if(bRet && (lppd->Flags & PD_RETURNDC || lppd->Flags & PD_RETURNIC))
486 bRet = PRINTDLG_CreateDC16(lppd);
488 TRACE("exit! (%d)\n", bRet);
489 return bRet;
492 /**********************************************************************
494 * 16 bit commdlg
497 /***********************************************************************
498 * PrintDlgProc (COMMDLG.21)
500 BOOL16 CALLBACK PrintDlgProc16(HWND16 hDlg16, UINT16 uMsg, WPARAM16 wParam,
501 LPARAM lParam)
503 HWND hDlg = HWND_32(hDlg16);
504 PRINT_PTRA* PrintStructures;
505 BOOL16 res = FALSE;
507 if (uMsg!=WM_INITDIALOG) {
508 PrintStructures = (PRINT_PTRA*)GetPropA(hDlg,"__WINE_PRINTDLGDATA");
509 if (!PrintStructures)
510 return FALSE;
511 } else {
512 PrintStructures = (PRINT_PTRA*) lParam;
513 SetPropA(hDlg,"__WINE_PRINTDLGDATA",PrintStructures);
514 res = PRINTDLG_WMInitDialog16(hDlg, wParam, PrintStructures);
516 if(PrintStructures->dlg.lpPrintDlg16->Flags & PD_ENABLEPRINTHOOK) {
517 res = CallWindowProc16(
518 (WNDPROC16)PrintStructures->dlg.lpPrintDlg16->lpfnPrintHook,
519 hDlg16, uMsg, wParam, (LPARAM)PrintStructures->dlg.lpPrintDlg16
522 return res;
525 if(PrintStructures->dlg.lpPrintDlg16->Flags & PD_ENABLEPRINTHOOK) {
526 res = CallWindowProc16(
527 (WNDPROC16)PrintStructures->dlg.lpPrintDlg16->lpfnPrintHook,
528 hDlg16,uMsg, wParam, lParam
530 if(LOWORD(res)) return res;
533 switch (uMsg) {
534 case WM_COMMAND: {
535 /* We need to map those for the 32bit window procedure, compare
536 * with 32Ato16 mapper in winproc.c
538 return PRINTDLG_WMCommandA(
539 hDlg,
540 MAKEWPARAM(wParam,HIWORD(lParam)),
541 LOWORD(lParam),
542 PrintStructures
545 case WM_DESTROY:
546 DestroyIcon(PrintStructures->hCollateIcon);
547 DestroyIcon(PrintStructures->hNoCollateIcon);
548 /* FIXME: don't forget to delete the paper orientation icons here! */
550 return FALSE;
552 return res;
555 /***********************************************************************
556 * PrintSetupDlgProc (COMMDLG.22)
558 BOOL16 CALLBACK PrintSetupDlgProc16(HWND16 hWnd16, UINT16 wMsg, WPARAM16 wParam,
559 LPARAM lParam)
561 HWND hWnd = HWND_32(hWnd16);
562 switch (wMsg)
564 case WM_INITDIALOG:
565 TRACE("WM_INITDIALOG lParam=%08lX\n", lParam);
566 ShowWindow(hWnd, SW_SHOWNORMAL);
567 return (TRUE);
568 case WM_COMMAND:
569 switch (wParam) {
570 case IDOK:
571 EndDialog(hWnd, TRUE);
572 return(TRUE);
573 case IDCANCEL:
574 EndDialog(hWnd, FALSE);
575 return(TRUE);
577 return(FALSE);
579 return FALSE;