3 * @copy 2012 MinGW.org project
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
26 #pragma GCC system_header
34 #define LBSELCHSTRINGA "commdlg_LBSelChangedNotify"
35 #define SHAREVISTRINGA "commdlg_ShareViolation"
36 #define FILEOKSTRINGA "commdlg_FileNameOK"
37 #define COLOROKSTRINGA "commdlg_ColorOK"
38 #define SETRGBSTRINGA "commdlg_SetRGBColor"
39 #define HELPMSGSTRINGA "commdlg_help"
40 #define FINDMSGSTRINGA "commdlg_FindReplace"
41 #define LBSELCHSTRINGW L"commdlg_LBSelChangedNotify"
42 #define SHAREVISTRINGW L"commdlg_ShareViolation"
43 #define FILEOKSTRINGW L"commdlg_FileNameOK"
44 #define COLOROKSTRINGW L"commdlg_ColorOK"
45 #define SETRGBSTRINGW L"commdlg_SetRGBColor"
46 #define HELPMSGSTRINGW L"commdlg_help"
47 #define FINDMSGSTRINGW L"commdlg_FindReplace"
49 #define CDN_FIRST ((UINT)-601) /* also in commctrl.h */
50 #define CDN_LAST ((UINT)-699)
52 #define CDN_INITDONE CDN_FIRST
53 #define CDN_SELCHANGE (CDN_FIRST-1U)
54 #define CDN_FOLDERCHANGE (CDN_FIRST-2U)
55 #define CDN_SHAREVIOLATION (CDN_FIRST-3U)
56 #define CDN_HELP (CDN_FIRST-4U)
57 #define CDN_FILEOK (CDN_FIRST-5U)
58 #define CDN_TYPECHANGE (CDN_FIRST-6U)
59 #define CDM_FIRST (WM_USER+100)
60 #define CDM_LAST (WM_USER+200)
61 #define CDM_GETSPEC CDM_FIRST
62 #define CDM_GETFILEPATH (CDM_FIRST+1)
63 #define CDM_GETFOLDERPATH (CDM_FIRST+2)
64 #define CDM_GETFOLDERIDLIST (CDM_FIRST+3)
65 #define CDM_SETCONTROLTEXT (CDM_FIRST+4)
66 #define CDM_HIDECONTROL (CDM_FIRST+5)
67 #define CDM_SETDEFEXT (CDM_FIRST+6)
70 #define CC_PREVENTFULLOPEN 4
72 #define CC_ENABLEHOOK 16
73 #define CC_ENABLETEMPLATE 32
74 #define CC_ENABLETEMPLATEHANDLE 64
75 #define CC_SOLIDCOLOR 128
76 #define CC_ANYCOLOR 256
77 #define CF_SCREENFONTS 1
78 #define CF_PRINTERFONTS 2
81 #define CF_ENABLEHOOK 8
82 #define CF_ENABLETEMPLATE 16
83 #define CF_ENABLETEMPLATEHANDLE 32
84 #define CF_INITTOLOGFONTSTRUCT 64
85 #define CF_USESTYLE 128
86 #define CF_EFFECTS 256
88 #define CF_ANSIONLY 1024
89 #define CF_SCRIPTSONLY CF_ANSIONLY
90 #define CF_NOVECTORFONTS 2048
91 #define CF_NOOEMFONTS 2048
92 #define CF_NOSIMULATIONS 4096
93 #define CF_LIMITSIZE 8192
94 #define CF_FIXEDPITCHONLY 16384
95 #define CF_WYSIWYG 32768
96 #define CF_FORCEFONTEXIST 65536
97 #define CF_SCALABLEONLY 131072
98 #define CF_TTONLY 262144
99 #define CF_NOFACESEL 524288
100 #define CF_NOSTYLESEL 1048576
101 #define CF_NOSIZESEL 2097152
102 #define CF_SELECTSCRIPT 4194304
103 #define CF_NOSCRIPTSEL 8388608
104 #define CF_NOVERTFONTS 0x1000000
105 #define SIMULATED_FONTTYPE 0x8000
106 #define PRINTER_FONTTYPE 0x4000
107 #define SCREEN_FONTTYPE 0x2000
108 #define BOLD_FONTTYPE 0x100
109 #define ITALIC_FONTTYPE 0x0200
110 #define REGULAR_FONTTYPE 0x0400
111 #define WM_CHOOSEFONT_GETLOGFONT (WM_USER+1)
112 #define WM_CHOOSEFONT_SETLOGFONT (WM_USER+101)
113 #define WM_CHOOSEFONT_SETFLAGS (WM_USER+102)
114 #define OFN_ALLOWMULTISELECT 512
115 #define OFN_CREATEPROMPT 0x2000
116 #define OFN_ENABLEHOOK 32
117 #define OFN_ENABLESIZING 0x800000
118 #define OFN_ENABLETEMPLATE 64
119 #define OFN_ENABLETEMPLATEHANDLE 128
120 #define OFN_EXPLORER 0x80000
121 #define OFN_EXTENSIONDIFFERENT 0x400
122 #define OFN_FILEMUSTEXIST 0x1000
123 #define OFN_HIDEREADONLY 4
124 #define OFN_LONGNAMES 0x200000
125 #define OFN_NOCHANGEDIR 8
126 #define OFN_NODEREFERENCELINKS 0x100000
127 #define OFN_NOLONGNAMES 0x40000
128 #define OFN_NONETWORKBUTTON 0x20000
129 #define OFN_NOREADONLYRETURN 0x8000
130 #define OFN_NOTESTFILECREATE 0x10000
131 #define OFN_NOVALIDATE 256
132 #define OFN_OVERWRITEPROMPT 2
133 #define OFN_PATHMUSTEXIST 0x800
134 #define OFN_READONLY 1
135 #define OFN_SHAREAWARE 0x4000
136 #define OFN_SHOWHELP 16
137 #define OFN_SHAREFALLTHROUGH 2
138 #define OFN_SHARENOWARN 1
139 #define OFN_SHAREWARN 0
140 #define OFN_NODEREFERENCELINKS 0x100000
141 #define FR_DIALOGTERM 64
143 #define FR_ENABLEHOOK 256
144 #define FR_ENABLETEMPLATE 512
145 #define FR_ENABLETEMPLATEHANDLE 0x2000
146 #define FR_FINDNEXT 8
147 #define FR_HIDEUPDOWN 0x4000
148 #define FR_HIDEMATCHCASE 0x8000
149 #define FR_HIDEWHOLEWORD 0x10000
150 #define FR_MATCHALEFHAMZA 0x80000000
151 #define FR_MATCHCASE 4
152 #define FR_MATCHDIAC 0x20000000
153 #define FR_MATCHKASHIDA 0x40000000
154 #define FR_NOMATCHCASE 0x800
155 #define FR_NOUPDOWN 0x400
156 #define FR_NOWHOLEWORD 4096
157 #define FR_REPLACE 16
158 #define FR_REPLACEALL 32
159 #define FR_SHOWHELP 128
160 #define FR_WHOLEWORD 2
161 #define PD_ALLPAGES 0x00000000
162 #define PD_SELECTION 0x00000001
163 #define PD_PAGENUMS 0x00000002
164 #define PD_NOSELECTION 0x00000004
165 #define PD_NOPAGENUMS 0x00000008
166 #define PD_COLLATE 0x00000010
167 #define PD_PRINTTOFILE 0x00000020
168 #define PD_PRINTSETUP 0x00000040
169 #define PD_NOWARNING 0x00000080
170 #define PD_RETURNDC 0x00000100
171 #define PD_RETURNIC 0x00000200
172 #define PD_RETURNDEFAULT 0x00000400
173 #define PD_SHOWHELP 0x00000800
174 #define PD_ENABLEPRINTHOOK 0x00001000
175 #define PD_ENABLESETUPHOOK 0x00002000
176 #define PD_ENABLEPRINTTEMPLATE 0x00004000
177 #define PD_ENABLESETUPTEMPLATE 0x00008000
178 #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
179 #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
180 #define PD_USEDEVMODECOPIES 0x00040000
181 #define PD_USEDEVMODECOPIESANDCOLLATE 0x00040000
182 #define PD_DISABLEPRINTTOFILE 0x00080000
183 #define PD_HIDEPRINTTOFILE 0x00100000
184 #define PD_NONETWORKBUTTON 0x00200000
185 #define PSD_DEFAULTMINMARGINS 0
186 #define PSD_INWININIINTLMEASURE 0
187 #define PSD_MINMARGINS 1
188 #define PSD_MARGINS 2
189 #define PSD_INTHOUSANDTHSOFINCHES 4
190 #define PSD_INHUNDREDTHSOFMILLIMETERS 8
191 #define PSD_DISABLEMARGINS 16
192 #define PSD_DISABLEPRINTER 32
193 #define PSD_NOWARNING 128
194 #define PSD_DISABLEORIENTATION 256
195 #define PSD_DISABLEPAPER 512
196 #define PSD_RETURNDEFAULT 1024
197 #define PSD_SHOWHELP 2048
198 #define PSD_ENABLEPAGESETUPHOOK 8192
199 #define PSD_ENABLEPAGESETUPTEMPLATE 0x8000
200 #define PSD_ENABLEPAGESETUPTEMPLATEHANDLE 0x20000
201 #define PSD_ENABLEPAGEPAINTHOOK 0x40000
202 #define PSD_DISABLEPAGEPAINTING 0x80000
203 #define WM_PSD_PAGESETUPDLG WM_USER
204 #define WM_PSD_FULLPAGERECT (WM_USER+1)
205 #define WM_PSD_MINMARGINRECT (WM_USER+2)
206 #define WM_PSD_MARGINRECT (WM_USER+3)
207 #define WM_PSD_GREEKTEXTRECT (WM_USER+4)
208 #define WM_PSD_ENVSTAMPRECT (WM_USER+5)
209 #define WM_PSD_YAFULLPAGERECT (WM_USER+6)
210 #define CD_LBSELNOITEMS (-1)
211 #define CD_LBSELCHANGE 0
212 #define CD_LBSELSUB 1
213 #define CD_LBSELADD 2
214 #define DN_DEFAULTPRN 1
218 #define SNDMSG ::SendMessage
220 #define SNDMSG SendMessage
222 #endif /* ifndef SNDMSG */
224 #define CommDlg_OpenSave_GetSpec(d,s,m) ((int)SNDMSG((d),CDM_GETSPEC,(m),(LPARAM)(s)))
225 #define CommDlg_OpenSave_GetSpecA CommDlg_OpenSave_GetSpec
226 #define CommDlg_OpenSave_GetSpecW CommDlg_OpenSave_GetSpec
227 #define CommDlg_OpenSave_GetFilePath(d,s,m) ((int)SNDMSG((d),CDM_GETFILEPATH,(m),(LPARAM)(s)))
228 #define CommDlg_OpenSave_GetFilePathA CommDlg_OpenSave_GetFilePath
229 #define CommDlg_OpenSave_GetFilePathW CommDlg_OpenSave_GetFilePath
230 #define CommDlg_OpenSave_GetFolderPath(d,s,m) ((int)SNDMSG((d),CDM_GETFOLDERPATH,(m),(LPARAM)(LPSTR)(s)))
231 #define CommDlg_OpenSave_GetFolderPathA CommDlg_OpenSave_GetFolderPath
232 #define CommDlg_OpenSave_GetFolderPathW CommDlg_OpenSave_GetFolderPath
233 #define CommDlg_OpenSave_GetFolderIDList(d,i,m) ((int)SNDMSG((d),CDM_GETFOLDERIDLIST,(m),(LPARAM)(i)))
234 #define CommDlg_OpenSave_SetControlText(d,i,t) ((void)SNDMSG((d),CDM_SETCONTROLTEXT,(i),(LPARAM)(t)))
235 #define CommDlg_OpenSave_HideControl(d,i) ((void)SNDMSG((d),CDM_HIDECONTROL,(i),0))
236 #define CommDlg_OpenSave_SetDefExt(d,e) ((void)SNDMSG((d),CDM_SETDEFEXT,0,(LPARAM)(e)))
238 typedef UINT (APIENTRY *__CDHOOKPROC)(HWND,UINT,WPARAM,LPARAM);
239 typedef __CDHOOKPROC LPCCHOOKPROC;
240 typedef __CDHOOKPROC LPCFHOOKPROC;
241 typedef __CDHOOKPROC LPFRHOOKPROC;
242 typedef __CDHOOKPROC LPOFNHOOKPROC;
243 typedef __CDHOOKPROC LPPAGEPAINTHOOK;
244 typedef __CDHOOKPROC LPPAGESETUPHOOK;
245 typedef __CDHOOKPROC LPSETUPHOOKPROC;
246 typedef __CDHOOKPROC LPPRINTHOOKPROC;
247 typedef struct tagCHOOSECOLORA {
252 COLORREF* lpCustColors;
255 LPCCHOOKPROC lpfnHook;
256 LPCSTR lpTemplateName;
257 } CHOOSECOLORA,*LPCHOOSECOLORA;
258 typedef struct tagCHOOSECOLORW {
263 COLORREF* lpCustColors;
266 LPCCHOOKPROC lpfnHook;
267 LPCWSTR lpTemplateName;
268 } CHOOSECOLORW,*LPCHOOSECOLORW;
269 typedef struct tagCHOOSEFONTA {
273 LPLOGFONTA lpLogFont;
278 LPCFHOOKPROC lpfnHook;
279 LPCSTR lpTemplateName;
283 WORD ___MISSING_ALIGNMENT__;
286 } CHOOSEFONTA,*LPCHOOSEFONTA;
287 typedef struct tagCHOOSEFONTW {
291 LPLOGFONTW lpLogFont;
296 LPCFHOOKPROC lpfnHook;
297 LPCWSTR lpTemplateName;
301 WORD ___MISSING_ALIGNMENT__;
304 } CHOOSEFONTW,*LPCHOOSEFONTW;
305 typedef struct tagDEVNAMES {
310 } DEVNAMES,*LPDEVNAMES;
317 LPSTR lpstrReplaceWith;
319 WORD wReplaceWithLen;
321 LPFRHOOKPROC lpfnHook;
322 LPCSTR lpTemplateName;
323 } FINDREPLACEA,*LPFINDREPLACEA;
329 LPWSTR lpstrFindWhat;
330 LPWSTR lpstrReplaceWith;
332 WORD wReplaceWithLen;
334 LPFRHOOKPROC lpfnHook;
335 LPCWSTR lpTemplateName;
336 } FINDREPLACEW,*LPFINDREPLACEW;
337 typedef struct tagOFNA {
342 LPSTR lpstrCustomFilter;
343 DWORD nMaxCustFilter;
347 LPSTR lpstrFileTitle;
349 LPCSTR lpstrInitialDir;
356 LPOFNHOOKPROC lpfnHook;
357 LPCSTR lpTemplateName;
358 #if (_WIN32_WINNT >= 0x0500)
362 #endif /* (_WIN32_WINNT >= 0x0500) */
363 } OPENFILENAMEA,*LPOPENFILENAMEA;
364 typedef struct tagOFNW {
369 LPWSTR lpstrCustomFilter;
370 DWORD nMaxCustFilter;
374 LPWSTR lpstrFileTitle;
376 LPCWSTR lpstrInitialDir;
383 LPOFNHOOKPROC lpfnHook;
384 LPCWSTR lpTemplateName;
385 #if (_WIN32_WINNT >= 0x0500)
389 #endif /* (_WIN32_WINNT >= 0x0500) */
390 } OPENFILENAMEW,*LPOPENFILENAMEW;
391 typedef struct _OFNOTIFYA {
393 LPOPENFILENAMEA lpOFN;
395 } OFNOTIFYA,*LPOFNOTIFYA;
396 typedef struct _OFNOTIFYW {
398 LPOPENFILENAMEW lpOFN;
400 } OFNOTIFYW,*LPOFNOTIFYW;
401 typedef struct tagPSDA {
412 LPPAGESETUPHOOK lpfnPageSetupHook;
413 LPPAGEPAINTHOOK lpfnPagePaintHook;
414 LPCSTR lpPageSetupTemplateName;
415 HGLOBAL hPageSetupTemplate;
416 } PAGESETUPDLGA,*LPPAGESETUPDLGA;
417 typedef struct tagPSDW {
428 LPPAGESETUPHOOK lpfnPageSetupHook;
429 LPPAGEPAINTHOOK lpfnPagePaintHook;
430 LPCWSTR lpPageSetupTemplateName;
431 HGLOBAL hPageSetupTemplate;
432 } PAGESETUPDLGW,*LPPAGESETUPDLGW;
433 typedef struct tagPDA {
447 LPPRINTHOOKPROC lpfnPrintHook;
448 LPSETUPHOOKPROC lpfnSetupHook;
449 LPCSTR lpPrintTemplateName;
450 LPCSTR lpSetupTemplateName;
451 HANDLE hPrintTemplate;
452 HANDLE hSetupTemplate;
453 } PRINTDLGA,*LPPRINTDLGA;
454 typedef struct tagPDW {
468 LPPRINTHOOKPROC lpfnPrintHook;
469 LPSETUPHOOKPROC lpfnSetupHook;
470 LPCWSTR lpPrintTemplateName;
471 LPCWSTR lpSetupTemplateName;
472 HANDLE hPrintTemplate;
473 HANDLE hSetupTemplate;
474 } PRINTDLGW,*LPPRINTDLGW;
476 BOOL WINAPI ChooseColorA(LPCHOOSECOLORA);
477 BOOL WINAPI ChooseColorW(LPCHOOSECOLORW);
478 BOOL WINAPI ChooseFontA(LPCHOOSEFONTA);
479 BOOL WINAPI ChooseFontW(LPCHOOSEFONTW);
480 DWORD WINAPI CommDlgExtendedError(void);
481 HWND WINAPI FindTextA(LPFINDREPLACEA);
482 HWND WINAPI FindTextW(LPFINDREPLACEW);
483 short WINAPI GetFileTitleA(LPCSTR,LPSTR,WORD);
484 short WINAPI GetFileTitleW(LPCWSTR,LPWSTR,WORD);
485 BOOL WINAPI GetOpenFileNameA(LPOPENFILENAMEA);
486 BOOL WINAPI GetOpenFileNameW(LPOPENFILENAMEW);
487 BOOL WINAPI GetSaveFileNameA(LPOPENFILENAMEA);
488 BOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW);
489 BOOL WINAPI PageSetupDlgA(LPPAGESETUPDLGA);
490 BOOL WINAPI PageSetupDlgW(LPPAGESETUPDLGW);
491 BOOL WINAPI PrintDlgA(LPPRINTDLGA);
492 BOOL WINAPI PrintDlgW(LPPRINTDLGW);
493 HWND WINAPI ReplaceTextA(LPFINDREPLACEA);
494 HWND WINAPI ReplaceTextW(LPFINDREPLACEW);
496 #define LBSELCHSTRING __AW(LBSELCHSTRING)
497 #define SHAREVISTRING __AW(SHAREVISTRING)
498 #define FILEOKSTRING __AW(FILEOKSTRING)
499 #define COLOROKSTRING __AW(COLOROKSTRING)
500 #define SETRGBSTRING __AW(SETRGBSTRING)
501 #define HELPMSGSTRING __AW(HELPMSGSTRING)
502 #define FINDMSGSTRING __AW(FINDMSGSTRING)
503 typedef __AW(CHOOSECOLOR) CHOOSECOLOR,*LPCHOOSECOLOR;
504 typedef __AW(CHOOSEFONT) CHOOSEFONT,*LPCHOOSEFONT;
505 typedef __AW(FINDREPLACE) FINDREPLACE,*LPFINDREPLACE;
506 typedef __AW(OPENFILENAME) OPENFILENAME,*LPOPENFILENAME;
507 typedef __AW(OFNOTIFY) OFNOTIFY,*LPOFNOTIFY;
508 typedef __AW(PAGESETUPDLG) PAGESETUPDLG,*LPPAGESETUPDLG;
509 typedef __AW(PRINTDLG) PRINTDLG,*LPPRINTDLG;
510 #define ChooseColor __AW(ChooseColor)
511 #define ChooseFont __AW(ChooseFont)
512 #define FindText __AW(FindText)
513 #define GetFileTitle __AW(GetFileTitle)
514 #define GetOpenFileName __AW(GetOpenFileName)
515 #define GetSaveFileName __AW(GetSaveFileName)
516 #define PageSetupDlg __AW(PageSetupDlg)
517 #define PrintDlg __AW(PrintDlg)
518 #define ReplaceText __AW(ReplaceText)
520 #if (WINVER >= 0x0500)
521 #define OFN_DONTADDTORECENT 0x02000000
522 #define PD_CURRENTPAGE 0x00400000
523 #define PD_NOCURRENTPAGE 0x00800000
524 #define PD_EXCLUSIONFLAGS 0x01000000
525 #define PD_USELARGETEMPLATE 0x10000000
526 #define PD_RESULT_CANCEL 0
527 #define PD_RESULT_PRINT 1
528 #define PD_RESULT_APPLY 2
529 #define START_PAGE_GENERAL 0XFFFFFFFF
530 #define OPENFILENAME_SIZE_VERSION_400 76
532 typedef __AW(PRINTDLGEX) PRINTDLGEX, *LPPRINTDLGEX;
533 #define PrintDlgEx __AW(PrintDlgEx)
534 #include <unknwn.h> /* for LPUNKNOWN */
535 #include <prsht.h> /* for HPROPSHEETPAGE */
536 typedef struct tagPRINTPAGERANGE {
539 } PRINTPAGERANGE, *LPPRINTPAGERANGE;
540 typedef struct tagPDEXA {
548 DWORD ExclusionFlags;
550 DWORD nMaxPageRanges;
551 LPPRINTPAGERANGE lpPageRanges;
556 LPCSTR lpPrintTemplateName;
557 LPUNKNOWN lpCallback;
558 DWORD nPropertyPages;
559 HPROPSHEETPAGE *lphPropertyPages;
561 DWORD dwResultAction;
562 } PRINTDLGEXA, *LPPRINTDLGEXA;
563 typedef struct tagPDEXW {
571 DWORD ExclusionFlags;
573 DWORD nMaxPageRanges;
574 LPPRINTPAGERANGE lpPageRanges;
579 LPCWSTR lpPrintTemplateName;
580 LPUNKNOWN lpCallback;
581 DWORD nPropertyPages;
582 HPROPSHEETPAGE *lphPropertyPages;
584 DWORD dwResultAction;
585 } PRINTDLGEXW, *LPPRINTDLGEXW;
586 HRESULT WINAPI PrintDlgExA(LPPRINTDLGEXA);
587 HRESULT WINAPI PrintDlgExW(LPPRINTDLGEXW);
588 #endif /* _OBJC_NO_COM */
589 #endif /* WINVER >= 0x0500 */