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