Release 960521
[wine/multimedia.git] / include / commdlg.h
blob84965e4cee034bdf06c94e481cc3954a60515708
1 /*
2 * COMMDLG - Common Wine Dialog ... :-)
3 */
5 #ifndef COMMDLG_H
6 #define COMMDLG_H
8 #include "wintypes.h" /* needed for CHOOSEFONT structure */
10 #ifndef WINELIB
11 #pragma pack(1)
12 #endif
14 #define RT_CURSOR MAKEINTRESOURCE(1)
15 #define RT_BITMAP MAKEINTRESOURCE(2)
16 #define RT_ICON MAKEINTRESOURCE(3)
17 #define RT_MENU MAKEINTRESOURCE(4)
18 #define RT_DIALOG MAKEINTRESOURCE(5)
19 #define RT_STRING MAKEINTRESOURCE(6)
20 #define RT_FONTDIR MAKEINTRESOURCE(7)
21 #define RT_FONT MAKEINTRESOURCE(8)
22 #define RT_ACCELERATOR MAKEINTRESOURCE(9)
23 #define RT_RCDATA MAKEINTRESOURCE(10)
25 #define RT_GROUP_CURSOR MAKEINTRESOURCE(12)
26 #define RT_GROUP_ICON MAKEINTRESOURCE(14)
28 #ifndef HGLOBAL
29 #define HGLOBAL HANDLE
30 #endif
32 #define OFN_READONLY 0x00000001
33 #define OFN_OVERWRITEPROMPT 0x00000002
34 #define OFN_HIDEREADONLY 0x00000004
35 #define OFN_NOCHANGEDIR 0x00000008
36 #define OFN_SHOWHELP 0x00000010
37 #define OFN_ENABLEHOOK 0x00000020
38 #define OFN_ENABLETEMPLATE 0x00000040
39 #define OFN_ENABLETEMPLATEHANDLE 0x00000080
40 #define OFN_NOVALIDATE 0x00000100
41 #define OFN_ALLOWMULTISELECT 0x00000200
42 #define OFN_EXTENSIONDIFFERENT 0x00000400
43 #define OFN_PATHMUSTEXIST 0x00000800
44 #define OFN_FILEMUSTEXIST 0x00001000
45 #define OFN_CREATEPROMPT 0x00002000
46 #define OFN_SHAREAWARE 0x00004000
47 #define OFN_NOREADONLYRETURN 0x00008000
48 #define OFN_NOTESTFILECREATE 0x00010000
50 #define OFN_SHAREFALLTHROUGH 2
51 #define OFN_SHARENOWARN 1
52 #define OFN_SHAREWARN 0
55 typedef struct {
56 DWORD lStructSize;
57 HWND hwndOwner;
58 HINSTANCE hInstance;
59 SEGPTR lpstrFilter;
60 SEGPTR lpstrCustomFilter;
61 DWORD nMaxCustFilter;
62 DWORD nFilterIndex;
63 SEGPTR lpstrFile;
64 DWORD nMaxFile;
65 SEGPTR lpstrFileTitle;
66 DWORD nMaxFileTitle;
67 SEGPTR lpstrInitialDir;
68 SEGPTR lpstrTitle;
69 DWORD Flags;
70 UINT nFileOffset;
71 UINT nFileExtension;
72 SEGPTR lpstrDefExt;
73 LPARAM lCustData;
74 /* UINT (CALLBACK *lpfnHook)(HWND, UINT, WPARAM, LPARAM);*/
75 FARPROC lpfnHook;
76 SEGPTR lpTemplateName;
77 } OPENFILENAME;
78 typedef OPENFILENAME * LPOPENFILENAME;
81 typedef struct {
82 DWORD lStructSize;
83 HWND hwndOwner;
84 HWND hInstance;
85 COLORREF rgbResult;
86 COLORREF *lpCustColors;
87 DWORD Flags;
88 LPARAM lCustData;
89 UINT (*lpfnHook)(HWND, UINT, WPARAM, LPARAM);
90 LPCSTR lpTemplateName;
91 } CHOOSECOLOR;
92 typedef CHOOSECOLOR *LPCHOOSECOLOR;
94 #define CC_RGBINIT 0x00000001
95 #define CC_FULLOPEN 0x00000002
96 #define CC_PREVENTFULLOPEN 0x00000004
97 #define CC_SHOWHELP 0x00000008
98 #define CC_ENABLEHOOK 0x00000010
99 #define CC_ENABLETEMPLATE 0x00000020
100 #define CC_ENABLETEMPLATEHANDLE 0x00000040
102 typedef struct {
103 DWORD lStructSize; /* size of this struct 0x20 */
104 HWND hwndOwner; /* handle to owner's window */
105 HINSTANCE hInstance; /* instance handle of.EXE that */
106 /* contains cust. dlg. template */
107 DWORD Flags; /* one or more of the FR_?? */
108 SEGPTR lpstrFindWhat; /* ptr. to search string */
109 SEGPTR lpstrReplaceWith; /* ptr. to replace string */
110 UINT wFindWhatLen; /* size of find buffer */
111 UINT wReplaceWithLen; /* size of replace buffer */
112 LPARAM lCustData; /* data passed to hook fn. */
113 /* UINT (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM); */
114 FARPROC lpfnHook;
115 SEGPTR lpTemplateName; /* custom template name */
116 } FINDREPLACE;
117 typedef FINDREPLACE *LPFINDREPLACE;
119 #define FR_DOWN 0x00000001
120 #define FR_WHOLEWORD 0x00000002
121 #define FR_MATCHCASE 0x00000004
122 #define FR_FINDNEXT 0x00000008
123 #define FR_REPLACE 0x00000010
124 #define FR_REPLACEALL 0x00000020
125 #define FR_DIALOGTERM 0x00000040
126 #define FR_SHOWHELP 0x00000080
127 #define FR_ENABLEHOOK 0x00000100
128 #define FR_ENABLETEMPLATE 0x00000200
129 #define FR_NOUPDOWN 0x00000400
130 #define FR_NOMATCHCASE 0x00000800
131 #define FR_NOWHOLEWORD 0x00001000
132 #define FR_ENABLETEMPLATEHANDLE 0x00002000
133 #define FR_HIDEUPDOWN 0x00004000
134 #define FR_HIDEMATCHCASE 0x00008000
135 #define FR_HIDEWHOLEWORD 0x00010000
138 typedef struct {
139 DWORD lStructSize;
140 HWND hwndOwner; /* caller's window handle */
141 HDC hDC; /* printer DC/IC or NULL */
142 SEGPTR lpLogFont; /* ptr. to a LOGFONT struct */
143 short iPointSize; /* 10 * size in points of selected font */
144 DWORD Flags WINE_PACKED; /* enum. type flags */
145 COLORREF rgbColors; /* returned text color */
146 LPARAM lCustData; /* data passed to hook fn. */
147 /* UINT (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);*/
148 FARPROC lpfnHook;
149 SEGPTR lpTemplateName; /* custom template name */
150 HINSTANCE hInstance; /* instance handle of.EXE that */
151 /* contains cust. dlg. template */
152 SEGPTR lpszStyle WINE_PACKED; /* return the style field here */
153 /* must be LF_FACESIZE or bigger */
154 UINT nFontType; /* same value reported to the */
155 /* EnumFonts callback with the */
156 /* extra FONTTYPE_ bits added */
157 short nSizeMin WINE_PACKED; /* minimum pt size allowed & */
158 short nSizeMax WINE_PACKED; /* max pt size allowed if */
159 /* CF_LIMITSIZE is used */
160 } CHOOSEFONT;
161 typedef CHOOSEFONT *LPCHOOSEFONT;
164 #define CF_SCREENFONTS 0x00000001
165 #define CF_PRINTERFONTS 0x00000002
166 #define CF_BOTH (CF_SCREENFONTS | CF_PRINTERFONTS)
167 #define CF_SHOWHELP 0x00000004L
168 #define CF_ENABLEHOOK 0x00000008L
169 #define CF_ENABLETEMPLATE 0x00000010L
170 #define CF_ENABLETEMPLATEHANDLE 0x00000020L
171 #define CF_INITTOLOGFONTSTRUCT 0x00000040L
172 #define CF_USESTYLE 0x00000080L
173 #define CF_EFFECTS 0x00000100L
174 #define CF_APPLY 0x00000200L
175 #define CF_ANSIONLY 0x00000400L
176 #define CF_NOVECTORFONTS 0x00000800L
177 #define CF_NOOEMFONTS CF_NOVECTORFONTS
178 #define CF_NOSIMULATIONS 0x00001000L
179 #define CF_LIMITSIZE 0x00002000L
180 #define CF_FIXEDPITCHONLY 0x00004000L
181 #define CF_WYSIWYG 0x00008000L /* use with CF_SCREENFONTS & CF_PRINTERFONTS */
182 #define CF_FORCEFONTEXIST 0x00010000L
183 #define CF_SCALABLEONLY 0x00020000L
184 #define CF_TTONLY 0x00040000L
185 #define CF_NOFACESEL 0x00080000L
186 #define CF_NOSTYLESEL 0x00100000L
187 #define CF_NOSIZESEL 0x00200000L
189 #define SIMULATED_FONTTYPE 0x8000
190 #define PRINTER_FONTTYPE 0x4000
191 #define SCREEN_FONTTYPE 0x2000
192 #define BOLD_FONTTYPE 0x0100
193 #define ITALIC_FONTTYPE 0x0200
194 #define REGULAR_FONTTYPE 0x0400
196 #define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
198 #define LBSELCHSTRING "commdlg_LBSelChangedNotify"
199 #define SHAREVISTRING "commdlg_ShareViolation"
200 #define FILEOKSTRING "commdlg_FileNameOK"
201 #define COLOROKSTRING "commdlg_ColorOK"
202 #define SETRGBSTRING "commdlg_SetRGBColor"
203 #define FINDMSGSTRING "commdlg_FindReplace"
204 #define HELPMSGSTRING "commdlg_help"
206 #define CD_LBSELNOITEMS -1
207 #define CD_LBSELCHANGE 0
208 #define CD_LBSELSUB 1
209 #define CD_LBSELADD 2
211 typedef struct {
212 DWORD lStructSize;
213 HWND hwndOwner;
214 HGLOBAL hDevMode;
215 HGLOBAL hDevNames;
216 HDC hDC;
217 DWORD Flags;
218 UINT nFromPage;
219 UINT nToPage;
220 UINT nMinPage;
221 UINT nMaxPage;
222 UINT nCopies;
223 HINSTANCE hInstance;
224 LPARAM lCustData;
225 /* UINT (CALLBACK* lpfnPrintHook)(HWND, UINT, WPARAM, LPARAM);
226 UINT (CALLBACK* lpfnSetupHook)(HWND, UINT, WPARAM, LPARAM);*/
227 FARPROC lpfnPrintHook;
228 FARPROC lpfnSetupHook;
229 SEGPTR lpPrintTemplateName;
230 SEGPTR lpSetupTemplateName;
231 HGLOBAL hPrintTemplate;
232 HGLOBAL hSetupTemplate;
233 } PRINTDLG;
234 typedef PRINTDLG * LPPRINTDLG;
237 #define PD_ALLPAGES 0x00000000
238 #define PD_SELECTION 0x00000001
239 #define PD_PAGENUMS 0x00000002
240 #define PD_NOSELECTION 0x00000004
241 #define PD_NOPAGENUMS 0x00000008
242 #define PD_COLLATE 0x00000010
243 #define PD_PRINTTOFILE 0x00000020
244 #define PD_PRINTSETUP 0x00000040
245 #define PD_NOWARNING 0x00000080
246 #define PD_RETURNDC 0x00000100
247 #define PD_RETURNIC 0x00000200
248 #define PD_RETURNDEFAULT 0x00000400
249 #define PD_SHOWHELP 0x00000800
250 #define PD_ENABLEPRINTHOOK 0x00001000
251 #define PD_ENABLESETUPHOOK 0x00002000
252 #define PD_ENABLEPRINTTEMPLATE 0x00004000
253 #define PD_ENABLESETUPTEMPLATE 0x00008000
254 #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
255 #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
256 #define PD_USEDEVMODECOPIES 0x00040000
257 #define PD_DISABLEPRINTTOFILE 0x00080000
258 #define PD_HIDEPRINTTOFILE 0x00100000
260 typedef struct {
261 UINT wDriverOffset;
262 UINT wDeviceOffset;
263 UINT wOutputOffset;
264 UINT wDefault;
265 } DEVNAMES;
266 typedef DEVNAMES * LPDEVNAMES;
268 #define DN_DEFAULTPRN 0x0001
271 #define CDERR_DIALOGFAILURE 0xFFFF
272 #define CDERR_GENERALCODES 0x0000
273 #define CDERR_STRUCTSIZE 0x0001
274 #define CDERR_INITIALIZATION 0x0002
275 #define CDERR_NOTEMPLATE 0x0003
276 #define CDERR_NOHINSTANCE 0x0004
277 #define CDERR_LOADSTRFAILURE 0x0005
278 #define CDERR_FINDRESFAILURE 0x0006
279 #define CDERR_LOADRESFAILURE 0x0007
280 #define CDERR_LOCKRESFAILURE 0x0008
281 #define CDERR_MEMALLOCFAILURE 0x0009
282 #define CDERR_MEMLOCKFAILURE 0x000A
283 #define CDERR_NOHOOK 0x000B
284 #define CDERR_REGISTERMSGFAIL 0x000C
286 /************************************************************************
287 * COMMDLG Resources placed in Wine SYSRES.DLL *
288 ************************************************************************/
290 #define OPENFILEDLG 3
291 #define SAVEFILEDLG 4
292 #define PRINTDLG 5
293 #define PRINTSETUPDLG 6
294 #define FONTDLG 7
295 #define COLORDLG 8
296 #define FINDDLG 9
297 #define REPLACEDLG 10
299 BOOL ChooseColor(LPCHOOSECOLOR lpChCol);
300 DWORD CommDlgExtendedError(void);
301 BOOL FindText(LPFINDREPLACE lpFind);
302 short GetFileTitle(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf);
303 BOOL GetOpenFileName(LPOPENFILENAME lpofn);
304 BOOL GetSaveFileName(LPOPENFILENAME lpofn);
305 BOOL PrintDlg(LPPRINTDLG lpPrint);
306 BOOL ReplaceText(LPFINDREPLACE lpFind);
307 BOOL ChooseFont(LPCHOOSEFONT lpChFont);
309 LRESULT FileOpenDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
310 LRESULT FileSaveDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
311 LRESULT ColorDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
312 LRESULT FindTextDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
313 LRESULT ReplaceTextDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
314 LRESULT PrintDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
315 LRESULT PrintSetupDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
316 LRESULT FormatCharDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
318 #ifndef WINELIB
319 #pragma pack(4)
320 #endif
322 #endif /* #ifdef COMMDLG_H */