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