2 * COMMDLG - Common Wine Dialog ... :-)
5 #ifndef __WINE_COMMDLG_H
6 #define __WINE_COMMDLG_H
12 #include "wintypes.h" /* needed for CHOOSEFONT structure */
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 #define OFN_READONLY 0x00000001
29 #define OFN_OVERWRITEPROMPT 0x00000002
30 #define OFN_HIDEREADONLY 0x00000004
31 #define OFN_NOCHANGEDIR 0x00000008
32 #define OFN_SHOWHELP 0x00000010
33 #define OFN_ENABLEHOOK 0x00000020
34 #define OFN_ENABLETEMPLATE 0x00000040
35 #define OFN_ENABLETEMPLATEHANDLE 0x00000080
36 #define OFN_NOVALIDATE 0x00000100
37 #define OFN_ALLOWMULTISELECT 0x00000200
38 #define OFN_EXTENSIONDIFFERENT 0x00000400
39 #define OFN_PATHMUSTEXIST 0x00000800
40 #define OFN_FILEMUSTEXIST 0x00001000
41 #define OFN_CREATEPROMPT 0x00002000
42 #define OFN_SHAREAWARE 0x00004000
43 #define OFN_NOREADONLYRETURN 0x00008000
44 #define OFN_NOTESTFILECREATE 0x00010000
46 #define OFN_UNICODE 0x40000000 /*to differ between 32W/A hook*/
47 #define OFN_WINE32 0x80000000 /* comdlg32 */
49 #define OFN_SHAREFALLTHROUGH 2
50 #define OFN_SHARENOWARN 1
51 #define OFN_SHAREWARN 0
56 HINSTANCE16 hInstance
;
58 SEGPTR lpstrCustomFilter
;
63 SEGPTR lpstrFileTitle
;
65 SEGPTR lpstrInitialDir
;
69 UINT16 nFileExtension
;
73 SEGPTR lpTemplateName
;
74 } OPENFILENAME16
,*LPOPENFILENAME16
;
79 HINSTANCE32 hInstance
;
81 LPSTR lpstrCustomFilter
;
88 LPCSTR lpstrInitialDir
;
96 LPCSTR lpTemplateName
;
97 } OPENFILENAME32A
,*LPOPENFILENAME32A
;
102 HINSTANCE32 hInstance
;
104 LPWSTR lpstrCustomFilter
;
105 DWORD nMaxCustFilter
;
109 LPWSTR lpstrFileTitle
;
111 LPCWSTR lpstrInitialDir
;
119 LPCWSTR lpTemplateName
;
120 } OPENFILENAME32W
,*LPOPENFILENAME32W
;
122 DECL_WINELIB_TYPE_AW(OPENFILENAME
);
123 DECL_WINELIB_TYPE_AW(LPOPENFILENAME
);
130 COLORREF
*lpCustColors
;
134 SEGPTR lpTemplateName
;
136 typedef CHOOSECOLOR
*LPCHOOSECOLOR
;
138 #define CC_RGBINIT 0x00000001
139 #define CC_FULLOPEN 0x00000002
140 #define CC_PREVENTFULLOPEN 0x00000004
141 #define CC_SHOWHELP 0x00000008
142 #define CC_ENABLEHOOK 0x00000010
143 #define CC_ENABLETEMPLATE 0x00000020
144 #define CC_ENABLETEMPLATEHANDLE 0x00000040
147 DWORD lStructSize
; /* size of this struct 0x20 */
148 HWND16 hwndOwner
; /* handle to owner's window */
149 HINSTANCE16 hInstance
; /* instance handle of.EXE that */
150 /* contains cust. dlg. template */
151 DWORD Flags
; /* one or more of the FR_?? */
152 SEGPTR lpstrFindWhat
; /* ptr. to search string */
153 SEGPTR lpstrReplaceWith
; /* ptr. to replace string */
154 UINT16 wFindWhatLen
; /* size of find buffer */
155 UINT16 wReplaceWithLen
; /* size of replace buffer */
156 LPARAM lCustData
; /* data passed to hook fn. */
158 SEGPTR lpTemplateName
; /* custom template name */
160 typedef FINDREPLACE
*LPFINDREPLACE
;
162 #define FR_DOWN 0x00000001
163 #define FR_WHOLEWORD 0x00000002
164 #define FR_MATCHCASE 0x00000004
165 #define FR_FINDNEXT 0x00000008
166 #define FR_REPLACE 0x00000010
167 #define FR_REPLACEALL 0x00000020
168 #define FR_DIALOGTERM 0x00000040
169 #define FR_SHOWHELP 0x00000080
170 #define FR_ENABLEHOOK 0x00000100
171 #define FR_ENABLETEMPLATE 0x00000200
172 #define FR_NOUPDOWN 0x00000400
173 #define FR_NOMATCHCASE 0x00000800
174 #define FR_NOWHOLEWORD 0x00001000
175 #define FR_ENABLETEMPLATEHANDLE 0x00002000
176 #define FR_HIDEUPDOWN 0x00004000
177 #define FR_HIDEMATCHCASE 0x00008000
178 #define FR_HIDEWHOLEWORD 0x00010000
185 HWND16 hwndOwner
; /* caller's window handle */
186 HDC16 hDC
; /* printer DC/IC or NULL */
187 SEGPTR lpLogFont
; /* ptr. to a LOGFONT struct */
188 short iPointSize
; /* 10 * size in points of selected font */
189 DWORD Flags WINE_PACKED
; /* enum. type flags */
190 COLORREF rgbColors
; /* returned text color */
191 LPARAM lCustData
; /* data passed to hook fn. */
193 SEGPTR lpTemplateName
; /* custom template name */
194 HINSTANCE16 hInstance
; /* instance handle of.EXE that */
195 /* contains cust. dlg. template */
196 SEGPTR lpszStyle WINE_PACKED
; /* return the style field here */
197 /* must be LF_FACESIZE or bigger */
198 UINT16 nFontType
; /* same value reported to the */
199 /* EnumFonts callback with the */
200 /* extra FONTTYPE_ bits added */
201 short nSizeMin WINE_PACKED
; /* minimum pt size allowed & */
202 short nSizeMax WINE_PACKED
; /* max pt size allowed if */
203 /* CF_LIMITSIZE is used */
205 typedef CHOOSEFONT
*LPCHOOSEFONT
;
209 #define CF_SCREENFONTS 0x00000001
210 #define CF_PRINTERFONTS 0x00000002
211 #define CF_BOTH (CF_SCREENFONTS | CF_PRINTERFONTS)
212 #define CF_SHOWHELP 0x00000004L
213 #define CF_ENABLEHOOK 0x00000008L
214 #define CF_ENABLETEMPLATE 0x00000010L
215 #define CF_ENABLETEMPLATEHANDLE 0x00000020L
216 #define CF_INITTOLOGFONTSTRUCT 0x00000040L
217 #define CF_USESTYLE 0x00000080L
218 #define CF_EFFECTS 0x00000100L
219 #define CF_APPLY 0x00000200L
220 #define CF_ANSIONLY 0x00000400L
221 #define CF_NOVECTORFONTS 0x00000800L
222 #define CF_NOOEMFONTS CF_NOVECTORFONTS
223 #define CF_NOSIMULATIONS 0x00001000L
224 #define CF_LIMITSIZE 0x00002000L
225 #define CF_FIXEDPITCHONLY 0x00004000L
226 #define CF_WYSIWYG 0x00008000L /* use with CF_SCREENFONTS & CF_PRINTERFONTS */
227 #define CF_FORCEFONTEXIST 0x00010000L
228 #define CF_SCALABLEONLY 0x00020000L
229 #define CF_TTONLY 0x00040000L
230 #define CF_NOFACESEL 0x00080000L
231 #define CF_NOSTYLESEL 0x00100000L
232 #define CF_NOSIZESEL 0x00200000L
234 #define SIMULATED_FONTTYPE 0x8000
235 #define PRINTER_FONTTYPE 0x4000
236 #define SCREEN_FONTTYPE 0x2000
237 #define BOLD_FONTTYPE 0x0100
238 #define ITALIC_FONTTYPE 0x0200
239 #define REGULAR_FONTTYPE 0x0400
241 #define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
243 #define LBSELCHSTRING "commdlg_LBSelChangedNotify"
244 #define SHAREVISTRING "commdlg_ShareViolation"
245 #define FILEOKSTRING "commdlg_FileNameOK"
246 #define COLOROKSTRING "commdlg_ColorOK"
247 #define SETRGBSTRING "commdlg_SetRGBColor"
248 #define FINDMSGSTRING "commdlg_FindReplace"
249 #define HELPMSGSTRING "commdlg_help"
251 #define CD_LBSELNOITEMS -1
252 #define CD_LBSELCHANGE 0
253 #define CD_LBSELSUB 1
254 #define CD_LBSELADD 2
268 HINSTANCE16 hInstance
;
270 WNDPROC16 lpfnPrintHook
;
271 WNDPROC16 lpfnSetupHook
;
272 SEGPTR lpPrintTemplateName
;
273 SEGPTR lpSetupTemplateName
;
274 HGLOBAL16 hPrintTemplate
;
275 HGLOBAL16 hSetupTemplate
;
277 typedef PRINTDLG
* LPPRINTDLG
;
279 #define PD_ALLPAGES 0x00000000
280 #define PD_SELECTION 0x00000001
281 #define PD_PAGENUMS 0x00000002
282 #define PD_NOSELECTION 0x00000004
283 #define PD_NOPAGENUMS 0x00000008
284 #define PD_COLLATE 0x00000010
285 #define PD_PRINTTOFILE 0x00000020
286 #define PD_PRINTSETUP 0x00000040
287 #define PD_NOWARNING 0x00000080
288 #define PD_RETURNDC 0x00000100
289 #define PD_RETURNIC 0x00000200
290 #define PD_RETURNDEFAULT 0x00000400
291 #define PD_SHOWHELP 0x00000800
292 #define PD_ENABLEPRINTHOOK 0x00001000
293 #define PD_ENABLESETUPHOOK 0x00002000
294 #define PD_ENABLEPRINTTEMPLATE 0x00004000
295 #define PD_ENABLESETUPTEMPLATE 0x00008000
296 #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
297 #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
298 #define PD_USEDEVMODECOPIES 0x00040000
299 #define PD_DISABLEPRINTTOFILE 0x00080000
300 #define PD_HIDEPRINTTOFILE 0x00100000
303 UINT16 wDriverOffset
;
304 UINT16 wDeviceOffset
;
305 UINT16 wOutputOffset
;
308 typedef DEVNAMES
* LPDEVNAMES
;
310 #define DN_DEFAULTPRN 0x0001
313 #define CDERR_DIALOGFAILURE 0xFFFF
314 #define CDERR_GENERALCODES 0x0000
315 #define CDERR_STRUCTSIZE 0x0001
316 #define CDERR_INITIALIZATION 0x0002
317 #define CDERR_NOTEMPLATE 0x0003
318 #define CDERR_NOHINSTANCE 0x0004
319 #define CDERR_LOADSTRFAILURE 0x0005
320 #define CDERR_FINDRESFAILURE 0x0006
321 #define CDERR_LOADRESFAILURE 0x0007
322 #define CDERR_LOCKRESFAILURE 0x0008
323 #define CDERR_MEMALLOCFAILURE 0x0009
324 #define CDERR_MEMLOCKFAILURE 0x000A
325 #define CDERR_NOHOOK 0x000B
326 #define CDERR_REGISTERMSGFAIL 0x000C
328 BOOL16
ChooseColor(LPCHOOSECOLOR lpChCol
);
329 DWORD
CommDlgExtendedError(void);
330 HWND16
FindText( SEGPTR find
);
331 INT16
GetFileTitle16(LPCSTR lpFile
, LPSTR lpTitle
, UINT16 cbBuf
);
332 INT16
GetFileTitle32A(LPCSTR lpFile
, LPSTR lpTitle
, UINT32 cbBuf
);
333 INT16
GetFileTitle32W(LPCWSTR lpFile
, LPWSTR lpTitle
, UINT32 cbBuf
);
334 #define GetFileTitle WINELIB_NAME_AW(GetFileTitle)
335 BOOL16
GetOpenFileName16(SEGPTR ofn
);
336 BOOL32
GetOpenFileName32A(LPOPENFILENAME32A ofn
);
337 BOOL32
GetOpenFileName32W(LPOPENFILENAME32W ofn
);
338 #define GetOpenFileName WINELIB_NAME_AW(GetOpenFileName)
339 BOOL16
GetSaveFileName16(SEGPTR ofn
);
340 BOOL32
GetSaveFileName32A(LPOPENFILENAME32A ofn
);
341 BOOL32
GetSaveFileName32W(LPOPENFILENAME32W ofn
);
342 #define GetSaveFileName WINELIB_NAME_AW(GetSaveFileName)
343 BOOL16
PrintDlg( SEGPTR print
);
344 HWND16
ReplaceText( SEGPTR find
);
345 BOOL16
ChooseFont(LPCHOOSEFONT lpChFont
);
347 LRESULT
FileOpenDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
348 LRESULT
FileSaveDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
349 LRESULT
ColorDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
350 LRESULT
FindTextDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
351 LRESULT
ReplaceTextDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
352 LRESULT
PrintDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
353 LRESULT
PrintSetupDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
354 LRESULT
FormatCharDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
360 #endif /* __WINE_COMMDLG_H */