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