Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

318 lines
12 KiB

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