Release 971221
[wine/multimedia.git] / include / commdlg.h
blob4f6e78e112b62bda36c5d03b0d9ca4836d0614ce
1 /*
2 * COMMDLG - Common Wine Dialog ... :-)
3 */
5 #ifndef __WINE_COMMDLG_H
6 #define __WINE_COMMDLG_H
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
12 #include "wintypes.h" /* needed for CHOOSEFONT structure */
14 #define OFN_READONLY 0x00000001
15 #define OFN_OVERWRITEPROMPT 0x00000002
16 #define OFN_HIDEREADONLY 0x00000004
17 #define OFN_NOCHANGEDIR 0x00000008
18 #define OFN_SHOWHELP 0x00000010
19 #define OFN_ENABLEHOOK 0x00000020
20 #define OFN_ENABLETEMPLATE 0x00000040
21 #define OFN_ENABLETEMPLATEHANDLE 0x00000080
22 #define OFN_NOVALIDATE 0x00000100
23 #define OFN_ALLOWMULTISELECT 0x00000200
24 #define OFN_EXTENSIONDIFFERENT 0x00000400
25 #define OFN_PATHMUSTEXIST 0x00000800
26 #define OFN_FILEMUSTEXIST 0x00001000
27 #define OFN_CREATEPROMPT 0x00002000
28 #define OFN_SHAREAWARE 0x00004000
29 #define OFN_NOREADONLYRETURN 0x00008000
30 #define OFN_NOTESTFILECREATE 0x00010000
32 #define OFN_UNICODE 0x40000000 /*to differ between 32W/A hook*/
33 #define OFN_WINE32 0x80000000 /* comdlg32 */
35 #define OFN_SHAREFALLTHROUGH 2
36 #define OFN_SHARENOWARN 1
37 #define OFN_SHAREWARN 0
39 typedef struct {
40 DWORD lStructSize;
41 HWND16 hwndOwner;
42 HINSTANCE16 hInstance;
43 SEGPTR lpstrFilter;
44 SEGPTR lpstrCustomFilter;
45 DWORD nMaxCustFilter;
46 DWORD nFilterIndex;
47 SEGPTR lpstrFile;
48 DWORD nMaxFile;
49 SEGPTR lpstrFileTitle;
50 DWORD nMaxFileTitle;
51 SEGPTR lpstrInitialDir;
52 SEGPTR lpstrTitle;
53 DWORD Flags;
54 UINT16 nFileOffset;
55 UINT16 nFileExtension;
56 SEGPTR lpstrDefExt;
57 LPARAM lCustData;
58 WNDPROC16 lpfnHook;
59 SEGPTR lpTemplateName;
60 } OPENFILENAME16,*LPOPENFILENAME16;
62 typedef struct {
63 DWORD lStructSize;
64 HWND32 hwndOwner;
65 HINSTANCE32 hInstance;
66 LPCSTR lpstrFilter;
67 LPSTR lpstrCustomFilter;
68 DWORD nMaxCustFilter;
69 DWORD nFilterIndex;
70 LPSTR lpstrFile;
71 DWORD nMaxFile;
72 LPSTR lpstrFileTitle;
73 DWORD nMaxFileTitle;
74 LPCSTR lpstrInitialDir;
75 LPCSTR lpstrTitle;
76 DWORD Flags;
77 WORD nFileOffset;
78 WORD nFileExtension;
79 LPCSTR lpstrDefExt;
80 LPARAM lCustData;
81 WNDPROC32 lpfnHook;
82 LPCSTR lpTemplateName;
83 } OPENFILENAME32A,*LPOPENFILENAME32A;
85 typedef struct {
86 DWORD lStructSize;
87 HWND32 hwndOwner;
88 HINSTANCE32 hInstance;
89 LPCWSTR lpstrFilter;
90 LPWSTR lpstrCustomFilter;
91 DWORD nMaxCustFilter;
92 DWORD nFilterIndex;
93 LPWSTR lpstrFile;
94 DWORD nMaxFile;
95 LPWSTR lpstrFileTitle;
96 DWORD nMaxFileTitle;
97 LPCWSTR lpstrInitialDir;
98 LPCWSTR lpstrTitle;
99 DWORD Flags;
100 WORD nFileOffset;
101 WORD nFileExtension;
102 LPCWSTR lpstrDefExt;
103 LPARAM lCustData;
104 WNDPROC32 lpfnHook;
105 LPCWSTR lpTemplateName;
106 } OPENFILENAME32W,*LPOPENFILENAME32W;
108 DECL_WINELIB_TYPE_AW(OPENFILENAME);
109 DECL_WINELIB_TYPE_AW(LPOPENFILENAME);
111 typedef struct {
112 DWORD lStructSize;
113 HWND16 hwndOwner;
114 HWND16 hInstance;
115 COLORREF rgbResult;
116 COLORREF *lpCustColors;
117 DWORD Flags;
118 LPARAM lCustData;
119 WNDPROC16 lpfnHook;
120 SEGPTR lpTemplateName;
121 } CHOOSECOLOR;
122 typedef CHOOSECOLOR *LPCHOOSECOLOR;
124 #define CC_RGBINIT 0x00000001
125 #define CC_FULLOPEN 0x00000002
126 #define CC_PREVENTFULLOPEN 0x00000004
127 #define CC_SHOWHELP 0x00000008
128 #define CC_ENABLEHOOK 0x00000010
129 #define CC_ENABLETEMPLATE 0x00000020
130 #define CC_ENABLETEMPLATEHANDLE 0x00000040
132 typedef struct {
133 DWORD lStructSize; /* size of this struct 0x20 */
134 HWND16 hwndOwner; /* handle to owner's window */
135 HINSTANCE16 hInstance; /* instance handle of.EXE that */
136 /* contains cust. dlg. template */
137 DWORD Flags; /* one or more of the FR_?? */
138 SEGPTR lpstrFindWhat; /* ptr. to search string */
139 SEGPTR lpstrReplaceWith; /* ptr. to replace string */
140 UINT16 wFindWhatLen; /* size of find buffer */
141 UINT16 wReplaceWithLen; /* size of replace buffer */
142 LPARAM lCustData; /* data passed to hook fn. */
143 WNDPROC16 lpfnHook;
144 SEGPTR lpTemplateName; /* custom template name */
145 } FINDREPLACE;
146 typedef FINDREPLACE *LPFINDREPLACE;
148 #define FR_DOWN 0x00000001
149 #define FR_WHOLEWORD 0x00000002
150 #define FR_MATCHCASE 0x00000004
151 #define FR_FINDNEXT 0x00000008
152 #define FR_REPLACE 0x00000010
153 #define FR_REPLACEALL 0x00000020
154 #define FR_DIALOGTERM 0x00000040
155 #define FR_SHOWHELP 0x00000080
156 #define FR_ENABLEHOOK 0x00000100
157 #define FR_ENABLETEMPLATE 0x00000200
158 #define FR_NOUPDOWN 0x00000400
159 #define FR_NOMATCHCASE 0x00000800
160 #define FR_NOWHOLEWORD 0x00001000
161 #define FR_ENABLETEMPLATEHANDLE 0x00002000
162 #define FR_HIDEUPDOWN 0x00004000
163 #define FR_HIDEMATCHCASE 0x00008000
164 #define FR_HIDEWHOLEWORD 0x00010000
167 #pragma pack(1)
169 typedef struct {
170 DWORD lStructSize;
171 HWND16 hwndOwner; /* caller's window handle */
172 HDC16 hDC; /* printer DC/IC or NULL */
173 SEGPTR lpLogFont; /* ptr. to a LOGFONT struct */
174 short iPointSize; /* 10 * size in points of selected font */
175 DWORD Flags WINE_PACKED; /* enum. type flags */
176 COLORREF rgbColors; /* returned text color */
177 LPARAM lCustData; /* data passed to hook fn. */
178 WNDPROC16 lpfnHook;
179 SEGPTR lpTemplateName; /* custom template name */
180 HINSTANCE16 hInstance; /* instance handle of.EXE that */
181 /* contains cust. dlg. template */
182 SEGPTR lpszStyle WINE_PACKED; /* return the style field here */
183 /* must be LF_FACESIZE or bigger */
184 UINT16 nFontType; /* same value reported to the */
185 /* EnumFonts callback with the */
186 /* extra FONTTYPE_ bits added */
187 short nSizeMin WINE_PACKED; /* minimum pt size allowed & */
188 short nSizeMax WINE_PACKED; /* max pt size allowed if */
189 /* CF_LIMITSIZE is used */
190 } CHOOSEFONT;
191 typedef CHOOSEFONT *LPCHOOSEFONT;
193 #pragma pack(4)
195 #define CF_SCREENFONTS 0x00000001
196 #define CF_PRINTERFONTS 0x00000002
197 #define CF_BOTH (CF_SCREENFONTS | CF_PRINTERFONTS)
198 #define CF_SHOWHELP 0x00000004L
199 #define CF_ENABLEHOOK 0x00000008L
200 #define CF_ENABLETEMPLATE 0x00000010L
201 #define CF_ENABLETEMPLATEHANDLE 0x00000020L
202 #define CF_INITTOLOGFONTSTRUCT 0x00000040L
203 #define CF_USESTYLE 0x00000080L
204 #define CF_EFFECTS 0x00000100L
205 #define CF_APPLY 0x00000200L
206 #define CF_ANSIONLY 0x00000400L
207 #define CF_NOVECTORFONTS 0x00000800L
208 #define CF_NOOEMFONTS CF_NOVECTORFONTS
209 #define CF_NOSIMULATIONS 0x00001000L
210 #define CF_LIMITSIZE 0x00002000L
211 #define CF_FIXEDPITCHONLY 0x00004000L
212 #define CF_WYSIWYG 0x00008000L /* use with CF_SCREENFONTS & CF_PRINTERFONTS */
213 #define CF_FORCEFONTEXIST 0x00010000L
214 #define CF_SCALABLEONLY 0x00020000L
215 #define CF_TTONLY 0x00040000L
216 #define CF_NOFACESEL 0x00080000L
217 #define CF_NOSTYLESEL 0x00100000L
218 #define CF_NOSIZESEL 0x00200000L
220 #define SIMULATED_FONTTYPE 0x8000
221 #define PRINTER_FONTTYPE 0x4000
222 #define SCREEN_FONTTYPE 0x2000
223 #define BOLD_FONTTYPE 0x0100
224 #define ITALIC_FONTTYPE 0x0200
225 #define REGULAR_FONTTYPE 0x0400
227 #define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
229 #define LBSELCHSTRING "commdlg_LBSelChangedNotify"
230 #define SHAREVISTRING "commdlg_ShareViolation"
231 #define FILEOKSTRING "commdlg_FileNameOK"
232 #define COLOROKSTRING "commdlg_ColorOK"
233 #define SETRGBSTRING "commdlg_SetRGBColor"
234 #define FINDMSGSTRING "commdlg_FindReplace"
235 #define HELPMSGSTRING "commdlg_help"
237 #define CD_LBSELNOITEMS -1
238 #define CD_LBSELCHANGE 0
239 #define CD_LBSELSUB 1
240 #define CD_LBSELADD 2
242 typedef struct
244 DWORD lStructSize;
245 HWND16 hwndOwner;
246 HGLOBAL16 hDevMode;
247 HGLOBAL16 hDevNames;
248 HDC16 hDC;
249 DWORD Flags;
250 WORD nFromPage;
251 WORD nToPage;
252 WORD nMinPage;
253 WORD nMaxPage;
254 WORD nCopies;
255 HINSTANCE16 hInstance;
256 LPARAM lCustData;
257 WNDPROC16 lpfnPrintHook;
258 WNDPROC16 lpfnSetupHook;
259 SEGPTR lpPrintTemplateName;
260 SEGPTR lpSetupTemplateName;
261 HGLOBAL16 hPrintTemplate;
262 HGLOBAL16 hSetupTemplate;
263 } PRINTDLG16, *LPPRINTDLG16;
265 typedef UINT32 (CALLBACK *LPPRINTHOOKPROC) (HWND32, UINT32, WPARAM32, LPARAM);
266 typedef UINT32 (CALLBACK *LPSETUPHOOKPROC) (HWND32, UINT32, WPARAM32, LPARAM);
268 typedef struct
270 DWORD lStructSize;
271 HWND32 hwndOwner;
272 HGLOBAL32 hDevMode;
273 HGLOBAL32 hDevNames;
274 HDC32 hDC;
275 DWORD Flags;
276 WORD nFromPage;
277 WORD nToPage;
278 WORD nMinPage;
279 WORD nMaxPage;
280 WORD nCopies;
281 HINSTANCE32 hInstance;
282 LPARAM lCustData;
283 LPPRINTHOOKPROC lpfnPrintHook;
284 LPSETUPHOOKPROC lpfnSetupHook;
285 LPCSTR lpPrintTemplateName;
286 LPCSTR lpSetupTemplateName;
287 HGLOBAL32 hPrintTemplate;
288 HGLOBAL32 hSetupTemplate;
289 } PRINTDLG32A, *LPPRINTDLG32A;
291 typedef struct
293 DWORD lStructSize;
294 HWND32 hwndOwner;
295 HGLOBAL32 hDevMode;
296 HGLOBAL32 hDevNames;
297 HDC32 hDC;
298 DWORD Flags;
299 WORD nFromPage;
300 WORD nToPage;
301 WORD nMinPage;
302 WORD nMaxPage;
303 WORD nCopies;
304 HINSTANCE32 hInstance;
305 LPARAM lCustData;
306 LPPRINTHOOKPROC lpfnPrintHook;
307 LPSETUPHOOKPROC lpfnSetupHook;
308 LPCWSTR lpPrintTemplateName;
309 LPCWSTR lpSetupTemplateName;
310 HGLOBAL32 hPrintTemplate;
311 HGLOBAL32 hSetupTemplate;
312 } PRINTDLG32W, *LPPRINTDLG32W;
314 DECL_WINELIB_TYPE_AW(PRINTDLG);
315 DECL_WINELIB_TYPE_AW(LPPRINTDLG);
317 #define PD_ALLPAGES 0x00000000
318 #define PD_SELECTION 0x00000001
319 #define PD_PAGENUMS 0x00000002
320 #define PD_NOSELECTION 0x00000004
321 #define PD_NOPAGENUMS 0x00000008
322 #define PD_COLLATE 0x00000010
323 #define PD_PRINTTOFILE 0x00000020
324 #define PD_PRINTSETUP 0x00000040
325 #define PD_NOWARNING 0x00000080
326 #define PD_RETURNDC 0x00000100
327 #define PD_RETURNIC 0x00000200
328 #define PD_RETURNDEFAULT 0x00000400
329 #define PD_SHOWHELP 0x00000800
330 #define PD_ENABLEPRINTHOOK 0x00001000
331 #define PD_ENABLESETUPHOOK 0x00002000
332 #define PD_ENABLEPRINTTEMPLATE 0x00004000
333 #define PD_ENABLESETUPTEMPLATE 0x00008000
334 #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
335 #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
336 #define PD_USEDEVMODECOPIES 0x00040000
337 #define PD_DISABLEPRINTTOFILE 0x00080000
338 #define PD_HIDEPRINTTOFILE 0x00100000
340 typedef struct {
341 UINT16 wDriverOffset;
342 UINT16 wDeviceOffset;
343 UINT16 wOutputOffset;
344 UINT16 wDefault;
345 } DEVNAMES;
346 typedef DEVNAMES * LPDEVNAMES;
348 #define DN_DEFAULTPRN 0x0001
351 #define CDERR_DIALOGFAILURE 0xFFFF
352 #define CDERR_GENERALCODES 0x0000
353 #define CDERR_STRUCTSIZE 0x0001
354 #define CDERR_INITIALIZATION 0x0002
355 #define CDERR_NOTEMPLATE 0x0003
356 #define CDERR_NOHINSTANCE 0x0004
357 #define CDERR_LOADSTRFAILURE 0x0005
358 #define CDERR_FINDRESFAILURE 0x0006
359 #define CDERR_LOADRESFAILURE 0x0007
360 #define CDERR_LOCKRESFAILURE 0x0008
361 #define CDERR_MEMALLOCFAILURE 0x0009
362 #define CDERR_MEMLOCKFAILURE 0x000A
363 #define CDERR_NOHOOK 0x000B
364 #define CDERR_REGISTERMSGFAIL 0x000C
366 BOOL16 WINAPI ChooseColor(LPCHOOSECOLOR lpChCol);
367 DWORD WINAPI CommDlgExtendedError(void);
368 HWND16 WINAPI FindText( SEGPTR find);
369 INT16 WINAPI GetFileTitle16(LPCSTR lpFile, LPSTR lpTitle, UINT16 cbBuf);
370 INT16 WINAPI GetFileTitle32A(LPCSTR lpFile, LPSTR lpTitle, UINT32 cbBuf);
371 INT16 WINAPI GetFileTitle32W(LPCWSTR lpFile, LPWSTR lpTitle, UINT32 cbBuf);
372 #define GetFileTitle WINELIB_NAME_AW(GetFileTitle)
373 BOOL16 WINAPI GetOpenFileName16(SEGPTR ofn);
374 BOOL32 WINAPI GetOpenFileName32A(LPOPENFILENAME32A ofn);
375 BOOL32 WINAPI GetOpenFileName32W(LPOPENFILENAME32W ofn);
376 #define GetOpenFileName WINELIB_NAME_AW(GetOpenFileName)
377 BOOL16 WINAPI GetSaveFileName16(SEGPTR ofn);
378 BOOL32 WINAPI GetSaveFileName32A(LPOPENFILENAME32A ofn);
379 BOOL32 WINAPI GetSaveFileName32W(LPOPENFILENAME32W ofn);
380 #define GetSaveFileName WINELIB_NAME_AW(GetSaveFileName)
381 BOOL16 WINAPI PrintDlg( SEGPTR print);
382 HWND16 WINAPI ReplaceText( SEGPTR find);
383 BOOL16 WINAPI ChooseFont(LPCHOOSEFONT lpChFont);
384 LRESULT WINAPI FileOpenDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
385 LRESULT WINAPI FileSaveDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
386 LRESULT WINAPI ColorDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
387 LRESULT WINAPI FindTextDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
388 LRESULT WINAPI ReplaceTextDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
389 LRESULT WINAPI PrintDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
390 LRESULT WINAPI PrintSetupDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
391 LRESULT WINAPI FormatCharDlgProc(HWND16 hWnd, UINT16 wMsg, WPARAM16 wParam, LPARAM lParam);
393 #ifdef __cplusplus
395 #endif
397 #endif /* __WINE_COMMDLG_H */