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