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