|
|
1.1 root 1: /*---------------------------------------------------------------------------
2: * commdlg.h -- Common dialog definitions.
3: *---------------------------------------------------------------------------
4: */
5:
6: #ifndef _COMMDLG_INCLUDED_
7: #define _COMMDLG_INCLUDED_
8:
9: #ifdef STRICT
10: typedef UINT (APIENTRY *LPOFNHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
11: #else
12: typedef BOOL (APIENTRY *LPOFNHOOKPROC) (HWND, UINT, DWORD, LONG);
13: #endif
14:
15: typedef struct tagOFN
16: {
17: DWORD lStructSize;
18: HWND hwndOwner;
19: HINSTANCE hInstance;
20: LPCSTR lpstrFilter;
21: LPSTR lpstrCustomFilter;
22: DWORD nMaxCustFilter;
23: DWORD nFilterIndex;
24: LPSTR lpstrFile;
25: DWORD nMaxFile;
26: LPSTR lpstrFileTitle;
27: DWORD nMaxFileTitle;
28: LPCSTR lpstrInitialDir;
29: LPCSTR lpstrTitle;
30: DWORD Flags;
31: WORD nFileOffset;
32: WORD nFileExtension;
33: LPCSTR lpstrDefExt;
34: DWORD lCustData;
35: LPOFNHOOKPROC lpfnHook;
36: LPCSTR lpTemplateName;
37: } OPENFILENAME;
38: typedef OPENFILENAME FAR * LPOPENFILENAME;
39:
40: BOOL APIENTRY GetOpenFileName(LPOPENFILENAME);
41: BOOL APIENTRY GetSaveFileName(LPOPENFILENAME);
42: short APIENTRY GetFileTitle(LPSTR, LPSTR, WORD);
43:
44: #define OFN_READONLY 0x00000001
45: #define OFN_OVERWRITEPROMPT 0x00000002
46: #define OFN_HIDEREADONLY 0x00000004
47: #define OFN_NOCHANGEDIR 0x00000008
48: #define OFN_SHOWHELP 0x00000010
49: #define OFN_ENABLEHOOK 0x00000020
50: #define OFN_ENABLETEMPLATE 0x00000040
51: #define OFN_ENABLETEMPLATEHANDLE 0x00000080
52: #define OFN_NOVALIDATE 0x00000100
53: #define OFN_ALLOWMULTISELECT 0x00000200
54: #define OFN_EXTENSIONDIFFERENT 0x00000400
55: #define OFN_PATHMUSTEXIST 0x00000800
56: #define OFN_FILEMUSTEXIST 0x00001000
57: #define OFN_CREATEPROMPT 0x00002000
58: #define OFN_SHAREAWARE 0x00004000
59: #define OFN_NOREADONLYRETURN 0x00008000
60: #define OFN_NOTESTFILECREATE 0x00010000
61:
62: /* Return values for the registered message sent to the hook function
63: * when a sharing violation occurs. OFN_SHAREFALLTHROUGH allows the
64: * filename to be accepted, OFN_SHARENOWARN rejects the name but puts
65: * up no warning (returned when the app has already put up a warning
66: * message), and OFN_SHAREWARN puts up the default warning message
67: * for sharing violations.
68: *
69: * Note: Undefined return values map to OFN_SHAREWARN, but are
70: * reserved for future use.
71: */
72:
73: #define OFN_SHAREFALLTHROUGH 2
74: #define OFN_SHARENOWARN 1
75: #define OFN_SHAREWARN 0
76:
77: #ifdef STRICT
78: typedef UINT (APIENTRY *LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
79: #else
80: typedef WORD (APIENTRY *LPCCHOOKPROC) (HWND, UINT, DWORD, LONG);
81: #endif
82:
83: typedef struct
84: {
85: DWORD lStructSize;
86: HWND hwndOwner;
87: HWND hInstance;
88: DWORD rgbResult;
89: LPDWORD lpCustColors;
90: DWORD Flags;
91: DWORD lCustData;
92: LPCCHOOKPROC lpfnHook;
93: LPCSTR lpTemplateName;
94: } CHOOSECOLOR;
95: typedef CHOOSECOLOR FAR *LPCHOOSECOLOR;
96:
97: BOOL APIENTRY ChooseColor(LPCHOOSECOLOR);
98:
99: #define CC_RGBINIT 0x00000001
100: #define CC_FULLOPEN 0x00000002
101: #define CC_PREVENTFULLOPEN 0x00000004
102: #define CC_SHOWHELP 0x00000008
103: #define CC_ENABLEHOOK 0x00000010
104: #define CC_ENABLETEMPLATE 0x00000020
105: #define CC_ENABLETEMPLATEHANDLE 0x00000040
106:
107: #ifdef STRICT
108: typedef UINT (APIENTRY *LPFRHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
109: #else
110: typedef BOOL (APIENTRY *LPFRHOOKPROC) (HWND, UINT, DWORD, LONG);
111: #endif
112:
113: typedef struct
114: {
115: DWORD lStructSize; /* size of this struct 0x20 */
116: HWND hwndOwner; /* handle to owner's window */
117: HINSTANCE hInstance; /* instance handle of.EXE that
118: * contains cust. dlg. template
119: */
120: DWORD Flags; /* one or more of the FR_?? */
121: LPSTR lpstrFindWhat; /* ptr. to search string */
122: LPSTR lpstrReplaceWith; /* ptr. to replace string */
123: WORD wFindWhatLen; /* size of find buffer */
124: WORD wReplaceWithLen; /* size of replace buffer */
125: DWORD lCustData; /* data passed to hook fn. */
126: LPFRHOOKPROC lpfnHook; /* ptr. to hook fn. or NULL */
127: LPCSTR lpTemplateName; /* custom template name */
128: } FINDREPLACE;
129:
130: typedef FINDREPLACE FAR *LPFINDREPLACE;
131:
132: #define FR_DOWN 0x00000001
133: #define FR_WHOLEWORD 0x00000002
134: #define FR_MATCHCASE 0x00000004
135: #define FR_FINDNEXT 0x00000008
136: #define FR_REPLACE 0x00000010
137: #define FR_REPLACEALL 0x00000020
138: #define FR_DIALOGTERM 0x00000040
139: #define FR_SHOWHELP 0x00000080
140: #define FR_ENABLEHOOK 0x00000100
141: #define FR_ENABLETEMPLATE 0x00000200
142: #define FR_NOUPDOWN 0x00000400
143: #define FR_NOMATCHCASE 0x00000800
144: #define FR_NOWHOLEWORD 0x00001000
145: #define FR_ENABLETEMPLATEHANDLE 0x00002000
146: #define FR_HIDEUPDOWN 0x00004000
147: #define FR_HIDEMATCHCASE 0x00008000
148: #define FR_HIDEWHOLEWORD 0x00010000
149:
150:
151: HWND APIENTRY FindText(LPFINDREPLACE);
152: HWND APIENTRY ReplaceText(LPFINDREPLACE);
153:
154: #ifdef STRICT
155: typedef UINT (APIENTRY *LPCFHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
156: #else
157: typedef BOOL (APIENTRY *LPCFHOOKPROC) (HWND, UINT, DWORD, LONG);
158: #endif
159:
160: typedef struct
161: {
162: DWORD lStructSize; /* */
163: HWND hwndOwner; /* caller's window handle */
164: HDC hDC; /* printer DC/IC or NULL */
165: LPLOGFONT lpLogFont; /* ptr. to a LOGFONT struct */
166: int iPointSize; /* 10 * size in points of selected font */
167: DWORD Flags; /* enum. type flags */
168: DWORD rgbColors; /* returned text color */
169: DWORD lCustData; /* data passed to hook fn. */
170: LPCFHOOKPROC lpfnHook; /* ptr. to hook function */
171: LPCSTR lpTemplateName; /* custom template name */
172: HINSTANCE hInstance; /* instance handle of.EXE that
173: * contains cust. dlg. template
174: */
175: LPSTR lpszStyle; /* return the style field here
176: * must be LF_FACESIZE or bigger */
177: WORD nFontType; /* same value reported to the EnumFonts
178: * call back with the extra FONTTYPE_
179: * bits added */
180: int nSizeMin; /* minimum pt size allowed & */
181: int nSizeMax; /* max pt size allowed if */
182: /* CF_LIMITSIZE is used */
183: } CHOOSEFONT;
184: typedef CHOOSEFONT FAR *LPCHOOSEFONT;
185:
186: BOOL APIENTRY ChooseFont(LPCHOOSEFONT);
187:
188: #define CF_SCREENFONTS 0x00000001
189: #define CF_PRINTERFONTS 0x00000002
190: #define CF_BOTH (CF_SCREENFONTS | CF_PRINTERFONTS)
191: #define CF_SHOWHELP 0x00000004L
192: #define CF_ENABLEHOOK 0x00000008L
193: #define CF_ENABLETEMPLATE 0x00000010L
194: #define CF_ENABLETEMPLATEHANDLE 0x00000020L
195: #define CF_INITTOLOGFONTSTRUCT 0x00000040L
196: #define CF_USESTYLE 0x00000080L
197: #define CF_EFFECTS 0x00000100L
198: #define CF_APPLY 0x00000200L
199: #define CF_ANSIONLY 0x00000400L
200: #define CF_NOVECTORFONTS 0x00000800L
201: #define CF_NOOEMFONTS CF_NOVECTORFONTS
202: #define CF_NOSIMULATIONS 0x00001000L
203: #define CF_LIMITSIZE 0x00002000L
204: #define CF_FIXEDPITCHONLY 0x00004000L
205: #define CF_WYSIWYG 0x00008000L /* must also have CF_SCREENFONTS & CF_PRINTERFONTS */
206: #define CF_FORCEFONTEXIST 0x00010000L
207: #define CF_SCALABLEONLY 0x00020000L
208: #define CF_TTONLY 0x00040000L
209: #define CF_NOFACESEL 0x00080000L
210: #define CF_NOSTYLESEL 0x00100000L
211: #define CF_NOSIZESEL 0x00200000L
212:
213: /* these are extra nFontType bits that are added to what is returned to the
214: * EnumFonts callback routine */
215:
216: #define SIMULATED_FONTTYPE 0x8000
217: #define PRINTER_FONTTYPE 0x4000
218: #define SCREEN_FONTTYPE 0x2000
219: #define BOLD_FONTTYPE 0x0100
220: #define ITALIC_FONTTYPE 0x0200
221: #define REGULAR_FONTTYPE 0x0400
222:
223: #define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
224:
225:
226: /* strings used to obtain unique window message for communication
227: * between dialog and caller
228: */
229: #define LBSELCHSTRING "commdlg_LBSelChangedNotify"
230: #define SHAREVISTRING "commdlg_ShareViolation"
231: #define FILEOKSTRING "commdlg_FileNameOK"
232: #define COLOROKSTRING "commdlg_ColorOK"
233: #define SETRGBSTRING "commdlg_SetRGBColor"
234: #define FINDMSGSTRING "commdlg_FindReplace"
235: #define HELPMSGSTRING "commdlg_help"
236:
237: /* HIWORD values for lParam of commdlg_LBSelChangeNotify message */
238: #define CD_LBSELNOITEMS -1
239: #define CD_LBSELCHANGE 0
240: #define CD_LBSELSUB 1
241: #define CD_LBSELADD 2
242:
243: #ifdef STRICT
244: typedef UINT (APIENTRY *LPPRINTHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
245: typedef UINT (APIENTRY *LPSETUPHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
246: #else
247: typedef int (APIENTRY *LPPRINTHOOKPROC) (HWND, UINT, DWORD, LONG);
248: typedef int (APIENTRY *LPSETUPHOOKPROC) (HWND, UINT, DWORD, LONG);
249: #endif
250:
251: typedef struct tagPD
252: {
253: DWORD lStructSize;
254: HWND hwndOwner;
255: HANDLE hDevMode;
256: HANDLE hDevNames;
257: HDC hDC;
258: DWORD Flags;
259: WORD nFromPage;
260: WORD nToPage;
261: WORD nMinPage;
262: WORD nMaxPage;
263: WORD nCopies;
264: HINSTANCE hInstance;
265: DWORD lCustData;
266: LPPRINTHOOKPROC lpfnPrintHook;
267: LPSETUPHOOKPROC lpfnSetupHook;
268: LPCSTR lpPrintTemplateName;
269: LPCSTR lpSetupTemplateName;
270: HANDLE hPrintTemplate;
271: HANDLE hSetupTemplate;
272: } PRINTDLG;
273: typedef PRINTDLG FAR * LPPRINTDLG;
274:
275: BOOL APIENTRY PrintDlg(LPPRINTDLG);
276:
277: #define PD_ALLPAGES 0x00000000
278: #define PD_SELECTION 0x00000001
279: #define PD_PAGENUMS 0x00000002
280: #define PD_NOSELECTION 0x00000004
281: #define PD_NOPAGENUMS 0x00000008
282: #define PD_COLLATE 0x00000010
283: #define PD_PRINTTOFILE 0x00000020
284: #define PD_PRINTSETUP 0x00000040
285: #define PD_NOWARNING 0x00000080
286: #define PD_RETURNDC 0x00000100
287: #define PD_RETURNIC 0x00000200
288: #define PD_RETURNDEFAULT 0x00000400
289: #define PD_SHOWHELP 0x00000800
290: #define PD_ENABLEPRINTHOOK 0x00001000
291: #define PD_ENABLESETUPHOOK 0x00002000
292: #define PD_ENABLEPRINTTEMPLATE 0x00004000
293: #define PD_ENABLESETUPTEMPLATE 0x00008000
294: #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
295: #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
296: #define PD_USEDEVMODECOPIES 0x00040000
297: #define PD_DISABLEPRINTTOFILE 0x00080000
298: #define PD_HIDEPRINTTOFILE 0x00100000
299:
300: typedef struct tagDEVNAMES
301: {
302: WORD wDriverOffset;
303: WORD wDeviceOffset;
304: WORD wOutputOffset;
305: WORD wDefault;
306: } DEVNAMES;
307: typedef DEVNAMES FAR * LPDEVNAMES;
308:
309: #define DN_DEFAULTPRN 0x0001
310:
311:
312: DWORD APIENTRY CommDlgExtendedError(VOID);
313:
314:
315: #endif // _COMMDLG_INCLUDED_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.