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 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
50 HINSTANCE16 hInstance
;
52 SEGPTR lpstrCustomFilter
;
57 SEGPTR lpstrFileTitle
;
59 SEGPTR lpstrInitialDir
;
63 UINT16 nFileExtension
;
67 SEGPTR lpTemplateName
;
68 } OPENFILENAME16
,*LPOPENFILENAME16
;
73 HINSTANCE32 hInstance
;
75 LPSTR lpstrCustomFilter
;
82 LPCSTR lpstrInitialDir
;
90 LPCSTR lpTemplateName
;
91 } OPENFILENAME32A
,*LPOPENFILENAME32A
;
96 HINSTANCE32 hInstance
;
98 LPWSTR lpstrCustomFilter
;
103 LPWSTR lpstrFileTitle
;
105 LPCWSTR lpstrInitialDir
;
113 LPCWSTR lpTemplateName
;
114 } OPENFILENAME32W
,*LPOPENFILENAME32W
;
116 DECL_WINELIB_TYPE_AW(OPENFILENAME
)
117 DECL_WINELIB_TYPE_AW(LPOPENFILENAME
)
119 typedef UINT32 (CALLBACK
*LPCCHOOKPROC
) (HWND32
, UINT32
, WPARAM32
, LPARAM
);
126 COLORREF
*lpCustColors
;
130 SEGPTR lpTemplateName
;
132 typedef CHOOSECOLOR16
*LPCHOOSECOLOR16
;
139 LPDWORD lpCustColors
;
142 LPCCHOOKPROC lpfnHook
;
143 LPCSTR lpTemplateName
;
145 typedef CHOOSECOLOR32A
*LPCHOOSECOLOR32A
;
152 LPDWORD
*lpCustColors
;
155 LPCCHOOKPROC lpfnHook
;
156 LPCWSTR lpTemplateName
;
158 typedef CHOOSECOLOR32W
*LPCHOOSECOLOR32W
;
160 DECL_WINELIB_TYPE_AW(CHOOSECOLOR
)
161 DECL_WINELIB_TYPE_AW(LPCHOOSECOLOR
)
164 #define CC_RGBINIT 0x00000001
165 #define CC_FULLOPEN 0x00000002
166 #define CC_PREVENTFULLOPEN 0x00000004
167 #define CC_SHOWHELP 0x00000008
168 #define CC_ENABLEHOOK 0x00000010
169 #define CC_ENABLETEMPLATE 0x00000020
170 #define CC_ENABLETEMPLATEHANDLE 0x00000040
173 DWORD lStructSize
; /* size of this struct 0x20 */
174 HWND16 hwndOwner
; /* handle to owner's window */
175 HINSTANCE16 hInstance
; /* instance handle of.EXE that */
176 /* contains cust. dlg. template */
177 DWORD Flags
; /* one or more of the FR_?? */
178 SEGPTR lpstrFindWhat
; /* ptr. to search string */
179 SEGPTR lpstrReplaceWith
; /* ptr. to replace string */
180 UINT16 wFindWhatLen
; /* size of find buffer */
181 UINT16 wReplaceWithLen
; /* size of replace buffer */
182 LPARAM lCustData
; /* data passed to hook fn. */
184 SEGPTR lpTemplateName
; /* custom template name */
185 } FINDREPLACE16
, *LPFINDREPLACE16
;
190 HINSTANCE32 hInstance
;
194 LPSTR lpstrReplaceWith
;
196 WORD wReplaceWithLen
;
199 LPCSTR lpTemplateName
;
200 } FINDREPLACE32A
, *LPFINDREPLACE32A
;
205 HINSTANCE32 hInstance
;
208 LPWSTR lpstrFindWhat
;
209 LPWSTR lpstrReplaceWith
;
211 WORD wReplaceWithLen
;
214 LPCWSTR lpTemplateName
;
215 } FINDREPLACE32W
, *LPFINDREPLACE32W
;
217 DECL_WINELIB_TYPE_AW(FINDREPLACE
)
218 DECL_WINELIB_TYPE_AW(LPFINDREPLACE
)
220 #define FR_DOWN 0x00000001
221 #define FR_WHOLEWORD 0x00000002
222 #define FR_MATCHCASE 0x00000004
223 #define FR_FINDNEXT 0x00000008
224 #define FR_REPLACE 0x00000010
225 #define FR_REPLACEALL 0x00000020
226 #define FR_DIALOGTERM 0x00000040
227 #define FR_SHOWHELP 0x00000080
228 #define FR_ENABLEHOOK 0x00000100
229 #define FR_ENABLETEMPLATE 0x00000200
230 #define FR_NOUPDOWN 0x00000400
231 #define FR_NOMATCHCASE 0x00000800
232 #define FR_NOWHOLEWORD 0x00001000
233 #define FR_ENABLETEMPLATEHANDLE 0x00002000
234 #define FR_HIDEUPDOWN 0x00004000
235 #define FR_HIDEMATCHCASE 0x00008000
236 #define FR_HIDEWHOLEWORD 0x00010000
244 HWND16 hwndOwner
; /* caller's window handle */
245 HDC16 hDC
; /* printer DC/IC or NULL */
246 SEGPTR lpLogFont
; /* ptr. to a LOGFONT struct */
247 short iPointSize
; /* 10 * size in points of selected font */
248 DWORD Flags WINE_PACKED
; /* enum. type flags */
249 COLORREF rgbColors
; /* returned text color */
250 LPARAM lCustData
; /* data passed to hook fn. */
252 SEGPTR lpTemplateName
; /* custom template name */
253 HINSTANCE16 hInstance
; /* instance handle of.EXE that */
254 /* contains cust. dlg. template */
255 SEGPTR lpszStyle WINE_PACKED
; /* return the style field here */
256 /* must be LF_FACESIZE or bigger */
257 UINT16 nFontType
; /* same value reported to the */
258 /* EnumFonts callback with the */
259 /* extra FONTTYPE_ bits added */
260 short nSizeMin WINE_PACKED
; /* minimum pt size allowed & */
261 short nSizeMax WINE_PACKED
; /* max pt size allowed if */
262 /* CF_LIMITSIZE is used */
263 } CHOOSEFONT16
, *LPCHOOSEFONT16
;
271 LPLOGFONT32A lpLogFont
;
277 LPCSTR lpTemplateName
;
278 HINSTANCE32 hInstance
;
281 UINT16 ___MISSING_ALIGNMENT__
;
284 } CHOOSEFONT32A
, *LPCHOOSEFONT32A
;
291 LPLOGFONT32W lpLogFont
;
297 LPCWSTR lpTemplateName
;
298 HINSTANCE32 hInstance
;
301 UINT16 ___MISSING_ALIGNMENT__
;
304 } CHOOSEFONT32W
, *LPCHOOSEFONT32W
;
306 DECL_WINELIB_TYPE_AW(CHOOSEFONT
)
307 DECL_WINELIB_TYPE_AW(LPCHOOSEFONT
)
311 #define CF_SCREENFONTS 0x00000001
312 #define CF_PRINTERFONTS 0x00000002
313 #define CF_BOTH (CF_SCREENFONTS | CF_PRINTERFONTS)
314 #define CF_SHOWHELP 0x00000004L
315 #define CF_ENABLEHOOK 0x00000008L
316 #define CF_ENABLETEMPLATE 0x00000010L
317 #define CF_ENABLETEMPLATEHANDLE 0x00000020L
318 #define CF_INITTOLOGFONTSTRUCT 0x00000040L
319 #define CF_USESTYLE 0x00000080L
320 #define CF_EFFECTS 0x00000100L
321 #define CF_APPLY 0x00000200L
322 #define CF_ANSIONLY 0x00000400L
323 #define CF_SCRIPTSONLY CF_ANSIONLY
324 #define CF_NOVECTORFONTS 0x00000800L
325 #define CF_NOOEMFONTS CF_NOVECTORFONTS
326 #define CF_NOSIMULATIONS 0x00001000L
327 #define CF_LIMITSIZE 0x00002000L
328 #define CF_FIXEDPITCHONLY 0x00004000L
329 #define CF_WYSIWYG 0x00008000L /* use with CF_SCREENFONTS & CF_PRINTERFONTS */
330 #define CF_FORCEFONTEXIST 0x00010000L
331 #define CF_SCALABLEONLY 0x00020000L
332 #define CF_TTONLY 0x00040000L
333 #define CF_NOFACESEL 0x00080000L
334 #define CF_NOSTYLESEL 0x00100000L
335 #define CF_NOSIZESEL 0x00200000L
336 #define CF_SELECTSCRIPT 0x00400000L
337 #define CF_NOSCRIPTSEL 0x00800000L
338 #define CF_NOVERTFONTS 0x01000000L
340 #define SIMULATED_FONTTYPE 0x8000
341 #define PRINTER_FONTTYPE 0x4000
342 #define SCREEN_FONTTYPE 0x2000
343 #define BOLD_FONTTYPE 0x0100
344 #define ITALIC_FONTTYPE 0x0200
345 #define REGULAR_FONTTYPE 0x0400
347 #define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
348 #define WM_CHOOSEFONT_SETLOGFONT (WM_USER + 101)
349 #define WM_CHOOSEFONT_SETFLAGS (WM_USER + 102)
351 #define LBSELCHSTRING "commdlg_LBSelChangedNotify"
352 #define SHAREVISTRING "commdlg_ShareViolation"
353 #define FILEOKSTRING "commdlg_FileNameOK"
354 #define COLOROKSTRING "commdlg_ColorOK"
355 #define SETRGBSTRING "commdlg_SetRGBColor"
356 #define FINDMSGSTRING "commdlg_FindReplace"
357 #define HELPMSGSTRING "commdlg_help"
359 #define CD_LBSELNOITEMS -1
360 #define CD_LBSELCHANGE 0
361 #define CD_LBSELSUB 1
362 #define CD_LBSELADD 2
377 HINSTANCE16 hInstance
;
379 WNDPROC16 lpfnPrintHook
;
380 WNDPROC16 lpfnSetupHook
;
381 SEGPTR lpPrintTemplateName
;
382 SEGPTR lpSetupTemplateName
;
383 HGLOBAL16 hPrintTemplate
;
384 HGLOBAL16 hSetupTemplate
;
385 } PRINTDLG16
, *LPPRINTDLG16
;
387 typedef UINT32 (CALLBACK
*LPPRINTHOOKPROC
) (HWND32
, UINT32
, WPARAM32
, LPARAM
);
388 typedef UINT32 (CALLBACK
*LPSETUPHOOKPROC
) (HWND32
, UINT32
, WPARAM32
, LPARAM
);
403 HINSTANCE32 hInstance
;
405 LPPRINTHOOKPROC lpfnPrintHook
;
406 LPSETUPHOOKPROC lpfnSetupHook
;
407 LPCSTR lpPrintTemplateName
;
408 LPCSTR lpSetupTemplateName
;
409 HGLOBAL32 hPrintTemplate
;
410 HGLOBAL32 hSetupTemplate
;
411 } PRINTDLG32A
, *LPPRINTDLG32A
;
426 HINSTANCE32 hInstance
;
428 LPPRINTHOOKPROC lpfnPrintHook
;
429 LPSETUPHOOKPROC lpfnSetupHook
;
430 LPCWSTR lpPrintTemplateName
;
431 LPCWSTR lpSetupTemplateName
;
432 HGLOBAL32 hPrintTemplate
;
433 HGLOBAL32 hSetupTemplate
;
434 } PRINTDLG32W
, *LPPRINTDLG32W
;
436 DECL_WINELIB_TYPE_AW(PRINTDLG
)
437 DECL_WINELIB_TYPE_AW(LPPRINTDLG
)
439 #define PD_ALLPAGES 0x00000000
440 #define PD_SELECTION 0x00000001
441 #define PD_PAGENUMS 0x00000002
442 #define PD_NOSELECTION 0x00000004
443 #define PD_NOPAGENUMS 0x00000008
444 #define PD_COLLATE 0x00000010
445 #define PD_PRINTTOFILE 0x00000020
446 #define PD_PRINTSETUP 0x00000040
447 #define PD_NOWARNING 0x00000080
448 #define PD_RETURNDC 0x00000100
449 #define PD_RETURNIC 0x00000200
450 #define PD_RETURNDEFAULT 0x00000400
451 #define PD_SHOWHELP 0x00000800
452 #define PD_ENABLEPRINTHOOK 0x00001000
453 #define PD_ENABLESETUPHOOK 0x00002000
454 #define PD_ENABLEPRINTTEMPLATE 0x00004000
455 #define PD_ENABLESETUPTEMPLATE 0x00008000
456 #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
457 #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
458 #define PD_USEDEVMODECOPIES 0x00040000
459 #define PD_DISABLEPRINTTOFILE 0x00080000
460 #define PD_HIDEPRINTTOFILE 0x00100000
463 UINT16 wDriverOffset
;
464 UINT16 wDeviceOffset
;
465 UINT16 wOutputOffset
;
468 typedef DEVNAMES
* LPDEVNAMES
;
470 #define DN_DEFAULTPRN 0x0001
473 #define CDERR_DIALOGFAILURE 0xFFFF
474 #define CDERR_GENERALCODES 0x0000
475 #define CDERR_STRUCTSIZE 0x0001
476 #define CDERR_INITIALIZATION 0x0002
477 #define CDERR_NOTEMPLATE 0x0003
478 #define CDERR_NOHINSTANCE 0x0004
479 #define CDERR_LOADSTRFAILURE 0x0005
480 #define CDERR_FINDRESFAILURE 0x0006
481 #define CDERR_LOADRESFAILURE 0x0007
482 #define CDERR_LOCKRESFAILURE 0x0008
483 #define CDERR_MEMALLOCFAILURE 0x0009
484 #define CDERR_MEMLOCKFAILURE 0x000A
485 #define CDERR_NOHOOK 0x000B
486 #define CDERR_REGISTERMSGFAIL 0x000C
488 /* PageSetupDlg stuff ... */
489 #define WM_PSD_PAGESETUPDLG (WM_USER )
490 #define WM_PSD_FULLPAGERECT (WM_USER+1)
491 #define WM_PSD_MINMARGINRECT (WM_USER+2)
492 #define WM_PSD_MARGINRECT (WM_USER+3)
493 #define WM_PSD_GREEKTEXTRECT (WM_USER+4)
494 #define WM_PSD_ENVSTAMPRECT (WM_USER+5)
495 #define WM_PSD_YAFULLPAGERECT (WM_USER+6)
497 typedef UINT32 (CALLBACK
* LPPAGEPAINTHOOK
)( HWND32
, UINT32
, WPARAM32
, LPARAM
);
498 typedef UINT32 (CALLBACK
* LPPAGESETUPHOOK
)( HWND32
, UINT32
, WPARAM32
, LPARAM
);
500 typedef struct tagPSD32A
510 HINSTANCE32 hInstance
;
512 LPPAGESETUPHOOK lpfnPageSetupHook
;
513 LPPAGEPAINTHOOK lpfnPagePaintHook
;
514 LPCSTR lpPageSetupTemplateName
;
515 HGLOBAL32 hPageSetupTemplate
;
516 } PAGESETUPDLG32A
,*LPPAGESETUPDLG32A
;
518 typedef struct tagPSD32W
528 HINSTANCE32 hInstance
;
530 LPPAGESETUPHOOK lpfnPageSetupHook
;
531 LPPAGEPAINTHOOK lpfnPagePaintHook
;
532 LPCWSTR lpPageSetupTemplateName
;
533 HGLOBAL32 hPageSetupTemplate
;
534 } PAGESETUPDLG32W
,*LPPAGESETUPDLG32W
;
535 DECL_WINELIB_TYPE_AW(PAGESETUPDLG
)
536 DECL_WINELIB_TYPE_AW(LPPAGESETUPDLG
)
538 #define PSD_DEFAULTMINMARGINS 0x00000000
539 #define PSD_INWININIINTLMEASURE 0x00000000
541 #define PSD_MINMARGINS 0x00000001
542 #define PSD_MARGINS 0x00000002
543 #define PSD_INTHOUSANDTHSOFINCHES 0x00000004
544 #define PSD_INHUNDREDTHSOFMILLIMETERS 0x00000008
545 #define PSD_DISABLEMARGINS 0x00000010
546 #define PSD_DISABLEPRINTER 0x00000020
547 #define PSD_NOWARNING 0x00000080
548 #define PSD_DISABLEORIENTATION 0x00000100
549 #define PSD_RETURNDEFAULT 0x00000400
550 #define PSD_DISABLEPAPER 0x00000200
551 #define PSD_SHOWHELP 0x00000800
552 #define PSD_ENABLEPAGESETUPHOOK 0x00002000
553 #define PSD_ENABLEPAGESETUPTEMPLATE 0x00008000
554 #define PSD_ENABLEPAGESETUPTEMPLATEHANDLE 0x00020000
555 #define PSD_ENABLEPAGEPAINTHOOK 0x00040000
556 #define PSD_DISABLEPAGEPAINTING 0x00080000
558 BOOL16 WINAPI
ChooseColor16(LPCHOOSECOLOR16 lpChCol
);
559 BOOL32 WINAPI
ChooseColor32A(LPCHOOSECOLOR32A lpChCol
);
560 BOOL32 WINAPI
ChooseColor32W(LPCHOOSECOLOR32W lpChCol
);
561 #define ChooseColor WINELIB_NAME_AW(ChooseColor)
562 DWORD WINAPI
CommDlgExtendedError(void);
563 HWND16 WINAPI
FindText16( SEGPTR find
);
564 HWND32 WINAPI
FindText32A(LPFINDREPLACE32A lpFind
);
565 HWND32 WINAPI
FindText32W(LPFINDREPLACE32W lpFind
);
566 #define FindText WINELIB_NAME_AW(FindText)
567 INT16 WINAPI
GetFileTitle16(LPCSTR lpFile
, LPSTR lpTitle
, UINT16 cbBuf
);
568 INT16 WINAPI
GetFileTitle32A(LPCSTR lpFile
, LPSTR lpTitle
, UINT32 cbBuf
);
569 INT16 WINAPI
GetFileTitle32W(LPCWSTR lpFile
, LPWSTR lpTitle
, UINT32 cbBuf
);
570 #define GetFileTitle WINELIB_NAME_AW(GetFileTitle)
571 BOOL16 WINAPI
GetOpenFileName16(SEGPTR ofn
);
572 BOOL32 WINAPI
GetOpenFileName32A(LPOPENFILENAME32A ofn
);
573 BOOL32 WINAPI
GetOpenFileName32W(LPOPENFILENAME32W ofn
);
574 #define GetOpenFileName WINELIB_NAME_AW(GetOpenFileName)
575 BOOL16 WINAPI
GetSaveFileName16(SEGPTR ofn
);
576 BOOL32 WINAPI
GetSaveFileName32A(LPOPENFILENAME32A ofn
);
577 BOOL32 WINAPI
GetSaveFileName32W(LPOPENFILENAME32W ofn
);
578 #define GetSaveFileName WINELIB_NAME_AW(GetSaveFileName)
579 BOOL32 WINAPI
PageSetupDlg32A( LPPAGESETUPDLG32A
);
580 BOOL32 WINAPI
PageSetupDlg32W( LPPAGESETUPDLG32W
);
581 #define PageSetupDlg WINELIB_NAME_AW(PageSetupDlg)
582 BOOL16 WINAPI
PrintDlg( SEGPTR print
);
583 HWND16 WINAPI
ReplaceText16( SEGPTR find
);
584 HWND32 WINAPI
ReplaceText32A( LPFINDREPLACE32A lpFind
);
585 HWND32 WINAPI
ReplaceText32W( LPFINDREPLACE32W lpFind
);
586 #define ReplaceText WINELIB_NAME_AW(ReplaceText)
587 BOOL16 WINAPI
ChooseFont16(LPCHOOSEFONT16
);
588 BOOL32 WINAPI
ChooseFont32A(LPCHOOSEFONT32A
);
589 BOOL32 WINAPI
ChooseFont32W(LPCHOOSEFONT32W
);
590 #define ChooseFont WINELIB_NAME_AW(ChooseFont)
591 LRESULT WINAPI
FileOpenDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
592 LRESULT WINAPI
FileSaveDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
593 LRESULT WINAPI
ColorDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
594 LRESULT WINAPI
FindTextDlgProc16(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
595 LRESULT WINAPI
FindTextDlgProc32A(HWND32 hWnd
, UINT32 wMsg
, WPARAM32 wParam
, LPARAM lParam
);
596 LRESULT WINAPI
FindTextDlgProc32W(HWND32 hWnd
, UINT32 wMsg
, WPARAM32 wParam
, LPARAM lParam
);
597 #define FindTextDlgProc WINELIB_NAME_AW(FindTextDlgProc)
598 LRESULT WINAPI
ReplaceTextDlgProc16(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
599 LRESULT WINAPI
ReplaceTextDlgProc32A(HWND32 hWnd
, UINT32 wMsg
, WPARAM32 wParam
, LPARAM lParam
);
600 LRESULT WINAPI
ReplaceTextDlgProc32W(HWND32 hWnd
, UINT32 wMsg
, WPARAM32 wParam
, LPARAM lParam
);
601 #define ReplaceTextProc WINELIB_NAME_AW(ReplaceTextDlgProc)
602 LRESULT WINAPI
PrintDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
603 LRESULT WINAPI
PrintSetupDlgProc(HWND16 hWnd
, UINT16 wMsg
, WPARAM16 wParam
, LPARAM lParam
);
604 LRESULT WINAPI
FormatCharDlgProc16(HWND16
,UINT16
,WPARAM16
,LPARAM
);
605 LRESULT WINAPI
FormatCharDlgProc32A(HWND32
,UINT32
,WPARAM32
,LPARAM
);
606 LRESULT WINAPI
FormatCharDlgProc32W(HWND32
,UINT32
,WPARAM32
,LPARAM
);
607 #define FormatCharDlgProc LIBWINE_NAME_AW(FormatCharDlgProc)
612 #endif /* __WINE_COMMDLG_H */