Better handling of custom templates and hooks.
[wine] / include / commdlg.h
1 /* 
2  * COMMDLG - Common Wine Dialog ... :-)
3  */
4
5 #ifndef __WINE_COMMDLG_H
6 #define __WINE_COMMDLG_H
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 #include "prsht.h"
13 #include "pshpack1.h"
14
15 #define OFN_READONLY                 0x00000001
16 #define OFN_OVERWRITEPROMPT          0x00000002
17 #define OFN_HIDEREADONLY             0x00000004
18 #define OFN_NOCHANGEDIR              0x00000008
19 #define OFN_SHOWHELP                 0x00000010
20 #define OFN_ENABLEHOOK               0x00000020
21 #define OFN_ENABLETEMPLATE           0x00000040
22 #define OFN_ENABLETEMPLATEHANDLE     0x00000080
23 #define OFN_NOVALIDATE               0x00000100
24 #define OFN_ALLOWMULTISELECT         0x00000200
25 #define OFN_EXTENSIONDIFFERENT       0x00000400
26 #define OFN_PATHMUSTEXIST            0x00000800
27 #define OFN_FILEMUSTEXIST            0x00001000
28 #define OFN_CREATEPROMPT             0x00002000
29 #define OFN_SHAREAWARE               0x00004000
30 #define OFN_NOREADONLYRETURN         0x00008000
31 #define OFN_NOTESTFILECREATE         0x00010000
32 #define OFN_NONETWORKBUTTON          0x00020000 
33 #define OFN_NOLONGNAMES              0x00040000
34 #define OFN_EXPLORER                 0x00080000
35 #define OFN_NODEREFERENCELINKS       0x00100000
36 #define OFN_LONGNAMES                0x00200000
37 #define OFN_ENABLEINCLUDENOTIFY      0x00400000
38 #define OFN_ENABLESIZING             0x00800000
39 #define OFN_DONTADDTORECENT          0x02000000
40 #define OFN_FORCESHOWHIDDEN          0x10000000
41
42 /* WINE internal flags */
43 #define OFN_UNICODE                  0x40000000 /*to differ between 32W/A hook*/
44 #define OFN_WINE                     0x80000000 /* comdlg32 */
45
46 #define OFN_SHAREFALLTHROUGH     2
47 #define OFN_SHARENOWARN          1
48 #define OFN_SHAREWARN            0
49
50 #define SAVE_DIALOG  1
51 #define OPEN_DIALOG  2
52     
53 typedef UINT CALLBACK (*LPOFNHOOKPROC)(HWND,UINT,WPARAM,LPARAM);
54
55 typedef struct {
56         DWORD           lStructSize;
57         HWND            hwndOwner;
58         HINSTANCE       hInstance;
59         LPCSTR          lpstrFilter;
60         LPSTR           lpstrCustomFilter;
61         DWORD           nMaxCustFilter;
62         DWORD           nFilterIndex;
63         LPSTR           lpstrFile;
64         DWORD           nMaxFile;
65         LPSTR           lpstrFileTitle;
66         DWORD           nMaxFileTitle;
67         LPCSTR          lpstrInitialDir;
68         LPCSTR          lpstrTitle;
69         DWORD           Flags;
70         WORD            nFileOffset;
71         WORD            nFileExtension;
72         LPCSTR          lpstrDefExt;
73         LPARAM          lCustData;
74         LPOFNHOOKPROC   lpfnHook;
75         LPCSTR          lpTemplateName;
76 } OPENFILENAMEA,*LPOPENFILENAMEA;
77
78 typedef struct {
79         DWORD           lStructSize;
80         HWND            hwndOwner;
81         HINSTANCE       hInstance;
82         LPCWSTR         lpstrFilter;
83         LPWSTR          lpstrCustomFilter;
84         DWORD           nMaxCustFilter;
85         DWORD           nFilterIndex;
86         LPWSTR          lpstrFile;
87         DWORD           nMaxFile;
88         LPWSTR          lpstrFileTitle;
89         DWORD           nMaxFileTitle;
90         LPCWSTR         lpstrInitialDir;
91         LPCWSTR         lpstrTitle;
92         DWORD           Flags;
93         WORD            nFileOffset;
94         WORD            nFileExtension;
95         LPCWSTR         lpstrDefExt;
96         LPARAM          lCustData;
97         LPOFNHOOKPROC   lpfnHook;
98         LPCWSTR         lpTemplateName;
99 } OPENFILENAMEW,*LPOPENFILENAMEW;
100
101 DECL_WINELIB_TYPE_AW(OPENFILENAME)
102 DECL_WINELIB_TYPE_AW(LPOPENFILENAME)
103
104 typedef struct
105 {
106         NMHDR           hdr;
107         LPOPENFILENAMEA lpOFN;
108         LPSTR           pszFile;
109 } OFNOTIFYA, *LPOFNOTIFYA;
110
111 typedef struct
112 {
113         NMHDR           hdr;
114         LPOPENFILENAMEW lpOFN;
115         LPWSTR          pszFile;
116 } OFNOTIFYW, *LPOFNOTIFYW;
117
118 DECL_WINELIB_TYPE_AW(OFNOTIFY)
119 DECL_WINELIB_TYPE_AW(LPOFNOTIFY)
120  
121 typedef UINT CALLBACK (*LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
122
123 typedef struct {
124         DWORD           lStructSize;
125         HWND            hwndOwner;
126         HWND            hInstance;
127         DWORD           rgbResult;
128         LPDWORD         lpCustColors;
129         DWORD           Flags;
130         DWORD           lCustData;
131         LPCCHOOKPROC    lpfnHook;
132         LPCSTR          lpTemplateName;
133 } CHOOSECOLORA;
134 typedef CHOOSECOLORA *LPCHOOSECOLORA;
135
136 typedef struct {
137         DWORD           lStructSize;
138         HWND            hwndOwner;
139         HWND            hInstance;
140         DWORD           rgbResult;
141         LPDWORD         lpCustColors;
142         DWORD           Flags;
143         DWORD           lCustData;
144         LPCCHOOKPROC    lpfnHook;
145         LPCWSTR         lpTemplateName;
146 } CHOOSECOLORW;
147 typedef CHOOSECOLORW *LPCHOOSECOLORW;
148
149 DECL_WINELIB_TYPE_AW(CHOOSECOLOR)
150 DECL_WINELIB_TYPE_AW(LPCHOOSECOLOR)
151
152
153 #define CC_RGBINIT               0x00000001
154 #define CC_FULLOPEN              0x00000002
155 #define CC_PREVENTFULLOPEN       0x00000004
156 #define CC_SHOWHELP              0x00000008
157 #define CC_ENABLEHOOK            0x00000010
158 #define CC_ENABLETEMPLATE        0x00000020
159 #define CC_ENABLETEMPLATEHANDLE  0x00000040
160
161 typedef UINT CALLBACK (*LPFRHOOKPROC)(HWND,UINT,WPARAM,LPARAM);
162
163 typedef struct {
164         DWORD           lStructSize;
165         HWND            hwndOwner;
166         HINSTANCE       hInstance;
167         DWORD           Flags;
168         LPSTR           lpstrFindWhat;
169         LPSTR           lpstrReplaceWith;
170         WORD            wFindWhatLen;
171         WORD            wReplaceWithLen;
172         LPARAM          lCustData;
173         LPFRHOOKPROC    lpfnHook;
174         LPCSTR          lpTemplateName;
175 } FINDREPLACEA, *LPFINDREPLACEA;
176
177 typedef struct {
178         DWORD           lStructSize;
179         HWND            hwndOwner;
180         HINSTANCE       hInstance;
181         DWORD           Flags;
182         LPWSTR          lpstrFindWhat;
183         LPWSTR          lpstrReplaceWith;
184         WORD            wFindWhatLen;
185         WORD            wReplaceWithLen;
186         LPARAM          lCustData;
187         LPFRHOOKPROC    lpfnHook;
188         LPCWSTR         lpTemplateName;
189 } FINDREPLACEW, *LPFINDREPLACEW;
190         
191 DECL_WINELIB_TYPE_AW(FINDREPLACE)
192 DECL_WINELIB_TYPE_AW(LPFINDREPLACE)
193         
194 #define FR_DOWN                         0x00000001
195 #define FR_WHOLEWORD                    0x00000002
196 #define FR_MATCHCASE                    0x00000004
197 #define FR_FINDNEXT                     0x00000008
198 #define FR_REPLACE                      0x00000010
199 #define FR_REPLACEALL                   0x00000020
200 #define FR_DIALOGTERM                   0x00000040
201 #define FR_SHOWHELP                     0x00000080
202 #define FR_ENABLEHOOK                   0x00000100
203 #define FR_ENABLETEMPLATE               0x00000200
204 #define FR_NOUPDOWN                     0x00000400
205 #define FR_NOMATCHCASE                  0x00000800
206 #define FR_NOWHOLEWORD                  0x00001000
207 #define FR_ENABLETEMPLATEHANDLE         0x00002000
208 #define FR_HIDEUPDOWN                   0x00004000
209 #define FR_HIDEMATCHCASE                0x00008000
210 #define FR_HIDEWHOLEWORD                0x00010000
211
212 typedef UINT CALLBACK (*LPCFHOOKPROC)(HWND,UINT,WPARAM,LPARAM);
213
214 typedef struct
215 {
216         UINT    lStructSize; 
217         HWND            hwndOwner; 
218         HDC             hDC; 
219         LPLOGFONTA    lpLogFont; 
220         INT             iPointSize; 
221         DWORD           Flags; 
222         COLORREF        rgbColors; 
223         LPARAM          lCustData; 
224         LPCFHOOKPROC    lpfnHook; 
225         LPCSTR          lpTemplateName; 
226         HINSTANCE       hInstance; 
227         LPSTR           lpszStyle; 
228         WORD            nFontType; 
229         WORD    ___MISSING_ALIGNMENT__; 
230         INT     nSizeMin; 
231         INT             nSizeMax; 
232 } CHOOSEFONTA, *LPCHOOSEFONTA;
233
234 typedef struct
235 {
236         UINT    lStructSize; 
237         HWND            hwndOwner; 
238         HDC             hDC; 
239         LPLOGFONTW    lpLogFont; 
240         INT             iPointSize; 
241         DWORD           Flags; 
242         COLORREF        rgbColors; 
243         LPARAM          lCustData; 
244         LPCFHOOKPROC    lpfnHook; 
245         LPCWSTR         lpTemplateName; 
246         HINSTANCE       hInstance; 
247         LPWSTR          lpszStyle; 
248         WORD            nFontType; 
249         WORD    ___MISSING_ALIGNMENT__; 
250         INT     nSizeMin; 
251         INT             nSizeMax; 
252 } CHOOSEFONTW, *LPCHOOSEFONTW;
253
254 DECL_WINELIB_TYPE_AW(CHOOSEFONT)
255 DECL_WINELIB_TYPE_AW(LPCHOOSEFONT)
256
257 #define CF_SCREENFONTS               0x00000001
258 #define CF_PRINTERFONTS              0x00000002
259 #define CF_BOTH                      (CF_SCREENFONTS | CF_PRINTERFONTS)
260 #define CF_SHOWHELP                  0x00000004L
261 #define CF_ENABLEHOOK                0x00000008L
262 #define CF_ENABLETEMPLATE            0x00000010L
263 #define CF_ENABLETEMPLATEHANDLE      0x00000020L
264 #define CF_INITTOLOGFONTSTRUCT       0x00000040L
265 #define CF_USESTYLE                  0x00000080L
266 #define CF_EFFECTS                   0x00000100L
267 #define CF_APPLY                     0x00000200L
268 #define CF_ANSIONLY                  0x00000400L
269 #define CF_SCRIPTSONLY               CF_ANSIONLY
270 #define CF_NOVECTORFONTS             0x00000800L
271 #define CF_NOOEMFONTS                CF_NOVECTORFONTS
272 #define CF_NOSIMULATIONS             0x00001000L
273 #define CF_LIMITSIZE                 0x00002000L
274 #define CF_FIXEDPITCHONLY            0x00004000L
275 #define CF_WYSIWYG                   0x00008000L /* use with CF_SCREENFONTS & CF_PRINTERFONTS */
276 #define CF_FORCEFONTEXIST            0x00010000L
277 #define CF_SCALABLEONLY              0x00020000L
278 #define CF_TTONLY                    0x00040000L
279 #define CF_NOFACESEL                 0x00080000L
280 #define CF_NOSTYLESEL                0x00100000L
281 #define CF_NOSIZESEL                 0x00200000L
282 #define CF_SELECTSCRIPT              0x00400000L
283 #define CF_NOSCRIPTSEL               0x00800000L
284 #define CF_NOVERTFONTS               0x01000000L
285
286 #define SIMULATED_FONTTYPE      0x8000
287 #define PRINTER_FONTTYPE        0x4000
288 #define SCREEN_FONTTYPE         0x2000
289 #define BOLD_FONTTYPE           0x0100
290 #define ITALIC_FONTTYPE         0x0200
291 #define REGULAR_FONTTYPE        0x0400
292
293 #define WM_CHOOSEFONT_GETLOGFONT        (WM_USER + 1)
294 #define WM_CHOOSEFONT_SETLOGFONT        (WM_USER + 101)
295 #define WM_CHOOSEFONT_SETFLAGS          (WM_USER + 102)
296
297 #define LBSELCHSTRING  "commdlg_LBSelChangedNotify"
298 #define SHAREVISTRING  "commdlg_ShareViolation"
299 #define FILEOKSTRING   "commdlg_FileNameOK"
300 #define COLOROKSTRING  "commdlg_ColorOK"
301 #define SETRGBSTRING   "commdlg_SetRGBColor"
302 #define FINDMSGSTRING  "commdlg_FindReplace"
303 #define HELPMSGSTRING  "commdlg_help"
304
305 #define CD_LBSELNOITEMS -1
306 #define CD_LBSELCHANGE   0
307 #define CD_LBSELSUB      1
308 #define CD_LBSELADD      2
309
310 #define CDN_FIRST   (0U-601U)
311 #define CDN_LAST    (0U-699U)
312
313 #define CDN_INITDONE            (CDN_FIRST - 0x0000)
314 #define CDN_SELCHANGE           (CDN_FIRST - 0x0001)
315 #define CDN_FOLDERCHANGE        (CDN_FIRST - 0x0002)
316 #define CDN_SHAREVIOLATION      (CDN_FIRST - 0x0003)
317 #define CDN_HELP                (CDN_FIRST - 0x0004)
318 #define CDN_FILEOK              (CDN_FIRST - 0x0005)
319 #define CDN_TYPECHANGE          (CDN_FIRST - 0x0006)
320
321 #define CDM_FIRST               (WM_USER + 100)
322 #define CDM_LAST                (WM_USER + 200)
323
324 #define CDM_GETSPEC             (CDM_FIRST + 0x0000)
325 #define CDM_GETFILEPATH         (CDM_FIRST + 0x0001)
326 #define CDM_GETFOLDERPATH       (CDM_FIRST + 0x0002)
327 #define CDM_GETFOLDERLIST       (CDM_FIRST + 0x0003)
328 #define CDM_SETCONTROLTEXT      (CDM_FIRST + 0x0004)
329 #define CDM_HIDECONTROL         (CDM_FIRST + 0x0005)
330 #define CDM_SETDEFEXT           (CDM_FIRST + 0x0006)
331
332
333 /* Messages to query information from the open or save dialogs */
334
335 #define CommDlg_OpenSave_GetSpecA(_hdlg, _psz, _cbmax) \
336         (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
337 #define CommDlg_OpenSave_GetSpecW(_hdlg, _psz, _cbmax) \
338         (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
339 #define CommDlg_OpenSave_GetSpec  WINELIB_NAME_AW(CommDlg_OpenSave_GetSpec)
340
341 #define CommDlg_OpenSave_GetFilePathA(_hdlg, _psz, _cbmax) \
342         (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
343 #define CommDlg_OpenSave_GetFilePathW(_hdlg, _psz, _cbmax) \
344         (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
345 #define CommDlg_OpenSave_GetFilePath  WINELIB_NAME_AW(CommDlg_OpenSave_GetFilePath)
346
347 #define CommDlg_OpenSave_GetFolderPathA(_hdlg, _psz, _cbmax) \
348         (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
349 #define CommDlg_OpenSave_GetFolderPathW(_hdlg, _psz, _cbmax) \
350         (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
351 #define CommDlg_OpenSave_GetFolderPath  WINELIB_NAME_AW(CommDlg_OpenSave_GetFolderPath)
352
353 #define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) \
354         (int)SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl)
355
356 #define CommDlg_OpenSave_SetControlText(_hdlg, _id, _text) \
357         (void)SNDMSG(_hdlg, CDM_SETCONTROLTEXT, (WPARAM)_id, (LPARAM)(LPSTR)_text)
358
359 #define CommDlg_OpenSave_HideControl(_hdlg, _id) \
360         (void)SNDMSG(_hdlg, CDM_HIDECONTROL, (WPARAM)_id, 0)
361
362 #define CommDlg_OpenSave_SetDefExt(_hdlg, _pszext) \
363         (void)SNDMSG(_hdlg, CDM_SETDEFEXT, 0, (LPARAM)(LPSTR)_pszext)
364
365 #define CommDlg_OpenSave_GetSpecA(_hdlg, _psz, _cbmax) \
366         (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
367 #define CommDlg_OpenSave_GetSpecW(_hdlg, _psz, _cbmax) \
368         (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
369 #define CommDlg_OpenSave_GetSpec WINELIB_NAME_AW(CommDlg_OpenSave_GetSpec)
370
371 #define CommDlg_OpenSave_GetFilePathA(_hdlg, _psz, _cbmax) \
372         (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
373 #define CommDlg_OpenSave_GetFilePathW(_hdlg, _psz, _cbmax) \
374         (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
375 #define CommDlg_OpenSave_GetFilePath WINELIB_NAME_AW(CommDlg_OpenSave_GetFilePath)
376
377 #define CommDlg_OpenSave_GetFolderPathA(_hdlg, _psz, _cbmax) \
378         (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
379 #define CommDlg_OpenSave_GetFolderPathW(_hdlg, _psz, _cbmax) \
380         (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
381 #define CommDlg_OpenSave_GetFolderPath WINELIB_NAME_AW(CommDlg_OpenSave_GetFolderPath)
382
383 #define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) \
384         (int)SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl)
385
386 #define CommDlg_OpenSave_SetControlText(_hdlg, _id, _text) \
387         (void)SNDMSG(_hdlg, CDM_SETCONTROLTEXT, (WPARAM)_id, (LPARAM)(LPSTR)_text)
388
389 #define CommDlg_OpenSave_HideControl(_hdlg, _id) \
390         (void)SNDMSG(_hdlg, CDM_HIDECONTROL, (WPARAM)_id, 0)
391
392 #define CommDlg_OpenSave_SetDefExt(_hdlg, _pszext) \
393         (void)SNDMSG(_hdlg, CDM_SETDEFEXT, 0, (LPARAM)(LPSTR)_pszext)
394
395
396 typedef UINT CALLBACK (*LPPRINTHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
397 typedef UINT CALLBACK (*LPSETUPHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
398
399 typedef struct tagPDA
400 {
401     DWORD            lStructSize;
402     HWND           hwndOwner;
403     HGLOBAL        hDevMode;
404     HGLOBAL        hDevNames;
405     HDC            hDC;
406     DWORD            Flags;
407     WORD             nFromPage;
408     WORD             nToPage;
409     WORD             nMinPage;
410     WORD             nMaxPage;
411     WORD             nCopies;
412     HINSTANCE      hInstance;
413     LPARAM           lCustData;
414     LPPRINTHOOKPROC  lpfnPrintHook;
415     LPSETUPHOOKPROC  lpfnSetupHook;
416     LPCSTR           lpPrintTemplateName;
417     LPCSTR           lpSetupTemplateName;
418     HGLOBAL        hPrintTemplate;
419     HGLOBAL        hSetupTemplate;
420 } PRINTDLGA, *LPPRINTDLGA;
421
422 typedef struct tagPDW
423 {
424     DWORD            lStructSize;
425     HWND           hwndOwner;
426     HGLOBAL        hDevMode;
427     HGLOBAL        hDevNames;
428     HDC            hDC;
429     DWORD            Flags;
430     WORD             nFromPage;
431     WORD             nToPage;
432     WORD             nMinPage;
433     WORD             nMaxPage;
434     WORD             nCopies;
435     HINSTANCE      hInstance;
436     LPARAM           lCustData;
437     LPPRINTHOOKPROC  lpfnPrintHook;
438     LPSETUPHOOKPROC  lpfnSetupHook;
439     LPCWSTR          lpPrintTemplateName;
440     LPCWSTR          lpSetupTemplateName;
441     HGLOBAL        hPrintTemplate;
442     HGLOBAL        hSetupTemplate;
443 } PRINTDLGW, *LPPRINTDLGW;
444
445 DECL_WINELIB_TYPE_AW(PRINTDLG)
446 DECL_WINELIB_TYPE_AW(LPPRINTDLG)
447
448 #define PD_ALLPAGES                  0x00000000
449 #define PD_SELECTION                 0x00000001
450 #define PD_PAGENUMS                  0x00000002
451 #define PD_NOSELECTION               0x00000004
452 #define PD_NOPAGENUMS                0x00000008
453 #define PD_COLLATE                   0x00000010
454 #define PD_PRINTTOFILE               0x00000020
455 #define PD_PRINTSETUP                0x00000040
456 #define PD_NOWARNING                 0x00000080
457 #define PD_RETURNDC                  0x00000100
458 #define PD_RETURNIC                  0x00000200
459 #define PD_RETURNDEFAULT             0x00000400
460 #define PD_SHOWHELP                  0x00000800
461 #define PD_ENABLEPRINTHOOK           0x00001000
462 #define PD_ENABLESETUPHOOK           0x00002000
463 #define PD_ENABLEPRINTTEMPLATE       0x00004000
464 #define PD_ENABLESETUPTEMPLATE       0x00008000
465 #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
466 #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
467 #define PD_USEDEVMODECOPIES          0x00040000
468 #define PD_USEDEVMODECOPIESANDCOLLATE 0x00040000
469 #define PD_DISABLEPRINTTOFILE        0x00080000
470 #define PD_HIDEPRINTTOFILE           0x00100000
471 #define PD_NONETWORKBUTTON           0x00200000
472
473 typedef struct
474 {
475     WORD  wDriverOffset;
476     WORD  wDeviceOffset;
477     WORD  wOutputOffset;
478     WORD  wDefault;
479 } DEVNAMES;
480 typedef DEVNAMES * LPDEVNAMES;
481
482 #define DN_DEFAULTPRN      0x0001
483
484 /* PageSetupDlg stuff ... */
485 #define WM_PSD_PAGESETUPDLG     (WM_USER  )
486 #define WM_PSD_FULLPAGERECT     (WM_USER+1)
487 #define WM_PSD_MINMARGINRECT    (WM_USER+2)
488 #define WM_PSD_MARGINRECT       (WM_USER+3)
489 #define WM_PSD_GREEKTEXTRECT    (WM_USER+4)
490 #define WM_PSD_ENVSTAMPRECT     (WM_USER+5)
491 #define WM_PSD_YAFULLPAGERECT   (WM_USER+6)
492
493 typedef UINT CALLBACK (*LPPAGEPAINTHOOK)( HWND, UINT, WPARAM, LPARAM );
494 typedef UINT CALLBACK (*LPPAGESETUPHOOK)( HWND, UINT, WPARAM, LPARAM );
495
496 typedef struct tagPSDA
497 {
498         DWORD           lStructSize;
499         HWND            hwndOwner;
500         HGLOBAL hDevMode;
501         HGLOBAL hDevNames;
502         DWORD           Flags;
503         POINT           ptPaperSize;
504         RECT            rtMinMargin;
505         RECT            rtMargin;
506         HINSTANCE       hInstance;
507         LPARAM          lCustData;
508         LPPAGESETUPHOOK lpfnPageSetupHook;
509         LPPAGEPAINTHOOK lpfnPagePaintHook;
510         LPCSTR          lpPageSetupTemplateName;
511         HGLOBAL hPageSetupTemplate;
512 } PAGESETUPDLGA,*LPPAGESETUPDLGA;
513
514 typedef struct tagPSDW
515 {
516         DWORD           lStructSize;
517         HWND            hwndOwner;
518         HGLOBAL hDevMode;
519         HGLOBAL hDevNames;
520         DWORD           Flags;
521         POINT           ptPaperSize;
522         RECT            rtMinMargin;
523         RECT            rtMargin;
524         HINSTANCE       hInstance;
525         LPARAM          lCustData;
526         LPPAGESETUPHOOK lpfnPageSetupHook;
527         LPPAGEPAINTHOOK lpfnPagePaintHook;
528         LPCWSTR         lpPageSetupTemplateName;
529         HGLOBAL hPageSetupTemplate;
530 } PAGESETUPDLGW,*LPPAGESETUPDLGW;
531 DECL_WINELIB_TYPE_AW(PAGESETUPDLG)
532 DECL_WINELIB_TYPE_AW(LPPAGESETUPDLG)
533
534 #define PSD_DEFAULTMINMARGINS             0x00000000
535 #define PSD_INWININIINTLMEASURE           0x00000000
536
537 #define PSD_MINMARGINS                    0x00000001
538 #define PSD_MARGINS                       0x00000002
539 #define PSD_INTHOUSANDTHSOFINCHES         0x00000004
540 #define PSD_INHUNDREDTHSOFMILLIMETERS     0x00000008
541 #define PSD_DISABLEMARGINS                0x00000010
542 #define PSD_DISABLEPRINTER                0x00000020
543 #define PSD_NOWARNING                     0x00000080
544 #define PSD_DISABLEORIENTATION            0x00000100
545 #define PSD_RETURNDEFAULT                 0x00000400
546 #define PSD_DISABLEPAPER                  0x00000200
547 #define PSD_SHOWHELP                      0x00000800
548 #define PSD_ENABLEPAGESETUPHOOK           0x00002000
549 #define PSD_ENABLEPAGESETUPTEMPLATE       0x00008000
550 #define PSD_ENABLEPAGESETUPTEMPLATEHANDLE 0x00020000
551 #define PSD_ENABLEPAGEPAINTHOOK           0x00040000
552 #define PSD_DISABLEPAGEPAINTING           0x00080000
553
554
555 BOOL  WINAPI ChooseColorA(LPCHOOSECOLORA lpChCol);
556 BOOL  WINAPI ChooseColorW(LPCHOOSECOLORW lpChCol);
557 #define ChooseColor WINELIB_NAME_AW(ChooseColor)
558 DWORD   WINAPI CommDlgExtendedError(void);
559 HWND  WINAPI FindTextA(LPFINDREPLACEA lpFind);
560 HWND  WINAPI FindTextW(LPFINDREPLACEW lpFind);
561 #define FindText WINELIB_NAME_AW(FindText)
562 short   WINAPI GetFileTitleA(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf);
563 short   WINAPI GetFileTitleW(LPCWSTR lpFile, LPWSTR lpTitle, UINT cbBuf);
564 #define GetFileTitle WINELIB_NAME_AW(GetFileTitle)
565 BOOL  WINAPI GetOpenFileNameA(LPOPENFILENAMEA ofn);
566 BOOL  WINAPI GetOpenFileNameW(LPOPENFILENAMEW ofn);
567 #define GetOpenFileName WINELIB_NAME_AW(GetOpenFileName)
568 BOOL  WINAPI GetSaveFileNameA(LPOPENFILENAMEA ofn);
569 BOOL  WINAPI GetSaveFileNameW(LPOPENFILENAMEW ofn);
570 #define GetSaveFileName WINELIB_NAME_AW(GetSaveFileName)
571 BOOL WINAPI PageSetupDlgA( LPPAGESETUPDLGA );
572 BOOL WINAPI PageSetupDlgW( LPPAGESETUPDLGW );
573 #define PageSetupDlg WINELIB_NAME_AW(PageSetupDlg)
574 BOOL  WINAPI PrintDlgA( LPPRINTDLGA printdlg);
575 BOOL  WINAPI PrintDlgW( LPPRINTDLGW printdlg);
576 #define PrintDlg WINELIB_NAME_AW(PrintDlg)
577 HWND  WINAPI ReplaceTextA( LPFINDREPLACEA lpFind);
578 HWND  WINAPI ReplaceTextW( LPFINDREPLACEW lpFind);
579 #define ReplaceText WINELIB_NAME_AW(ReplaceText)
580 BOOL  WINAPI ChooseFontA(LPCHOOSEFONTA);
581 BOOL  WINAPI ChooseFontW(LPCHOOSEFONTW);
582 #define ChooseFont WINELIB_NAME_AW(ChooseFont)
583
584 void COMDLG32_SetCommDlgExtendedError(DWORD err); 
585
586
587 #include "poppack.h"
588
589 #ifdef __cplusplus
590 }
591 #endif
592
593 #endif  /* __WINE_COMMDLG_H */