Source code of Windows XP (NT5)
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.

323 lines
13 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-1994, 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. //---------------------------------------------------------------------------
  21. typedef struct tagOFN
  22. {
  23. DWORD lStructSize;
  24. HWND hwndOwner;
  25. HINSTANCE hInstance;
  26. LPCSTR lpstrFilter;
  27. LPSTR lpstrCustomFilter;
  28. DWORD nMaxCustFilter;
  29. DWORD nFilterIndex;
  30. LPSTR lpstrFile;
  31. DWORD nMaxFile;
  32. LPSTR lpstrFileTitle;
  33. DWORD nMaxFileTitle;
  34. LPCSTR lpstrInitialDir;
  35. LPCSTR lpstrTitle;
  36. DWORD Flags;
  37. UINT nFileOffset;
  38. UINT nFileExtension;
  39. LPCSTR lpstrDefExt;
  40. LPARAM lCustData;
  41. UINT (CALLBACK *lpfnHook)(HWND, UINT, WPARAM, LPARAM);
  42. LPCSTR lpTemplateName;
  43. } OPENFILENAME;
  44. typedef OPENFILENAME FAR* LPOPENFILENAME;
  45. BOOL WINAPI GetOpenFileName(OPENFILENAME FAR*);
  46. BOOL WINAPI GetSaveFileName(OPENFILENAME FAR*);
  47. int WINAPI GetFileTitle(LPCSTR, LPSTR, UINT);
  48. #define OFN_READONLY 0x00000001
  49. #define OFN_OVERWRITEPROMPT 0x00000002
  50. #define OFN_HIDEREADONLY 0x00000004
  51. #define OFN_NOCHANGEDIR 0x00000008
  52. #define OFN_SHOWHELP 0x00000010
  53. #define OFN_ENABLEHOOK 0x00000020
  54. #define OFN_ENABLETEMPLATE 0x00000040
  55. #define OFN_ENABLETEMPLATEHANDLE 0x00000080
  56. #define OFN_NOVALIDATE 0x00000100
  57. #define OFN_ALLOWMULTISELECT 0x00000200
  58. #define OFN_EXTENSIONDIFFERENT 0x00000400
  59. #define OFN_PATHMUSTEXIST 0x00000800
  60. #define OFN_FILEMUSTEXIST 0x00001000
  61. #define OFN_CREATEPROMPT 0x00002000
  62. #define OFN_SHAREAWARE 0x00004000
  63. #define OFN_NOREADONLYRETURN 0x00008000
  64. #define OFN_NOTESTFILECREATE 0x00010000
  65. #define OFN_NONETWORKBUTTON 0x00020000
  66. #define OFN_NOLONGNAMES 0x00040000 // force no long names for 4.x modules
  67. #if (WINVER >= 0x400)
  68. #define OFN_EXPLORER 0x00080000
  69. #define OFN_NODEREFERENCELINKS 0x00100000
  70. #define OFN_LONGNAMES 0x00200000 // force long names for 3.x modules
  71. #endif /* WINVER >= 0x400 */
  72. /* Return values for the registered message sent to the hook function
  73. * when a sharing violation occurs. OFN_SHAREFALLTHROUGH allows the
  74. * filename to be accepted, OFN_SHARENOWARN rejects the name but puts
  75. * up no warning (returned when the app has already put up a warning
  76. * message), and OFN_SHAREWARN puts up the default warning message
  77. * for sharing violations.
  78. *
  79. * Note: Undefined return values map to OFN_SHAREWARN, but are
  80. * reserved for future use.
  81. */
  82. #define OFN_SHAREFALLTHROUGH 2
  83. #define OFN_SHARENOWARN 1
  84. #define OFN_SHAREWARN 0
  85. //---------------------------------------------------------------------------
  86. typedef struct tagCHOOSECOLOR
  87. {
  88. DWORD lStructSize;
  89. HWND hwndOwner;
  90. HINSTANCE hInstance;
  91. COLORREF rgbResult;
  92. COLORREF FAR* lpCustColors;
  93. DWORD Flags;
  94. LPARAM lCustData;
  95. UINT (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);
  96. LPCSTR lpTemplateName;
  97. } CHOOSECOLOR;
  98. typedef CHOOSECOLOR FAR *LPCHOOSECOLOR;
  99. BOOL WINAPI ChooseColor(CHOOSECOLOR FAR*);
  100. #define CC_RGBINIT 0x00000001
  101. #define CC_FULLOPEN 0x00000002
  102. #define CC_PREVENTFULLOPEN 0x00000004
  103. #define CC_SHOWHELP 0x00000008
  104. #define CC_ENABLEHOOK 0x00000010
  105. #define CC_ENABLETEMPLATE 0x00000020
  106. #define CC_ENABLETEMPLATEHANDLE 0x00000040
  107. //// reserved 0x?0000000
  108. //---------------------------------------------------------------------------
  109. typedef struct tagFINDREPLACE
  110. {
  111. DWORD lStructSize; /* size of this struct 0x20 */
  112. HWND hwndOwner; /* handle to owner's window */
  113. HINSTANCE hInstance; /* instance handle of.EXE that
  114. * contains cust. dlg. template
  115. */
  116. DWORD Flags; /* one or more of the FR_?? */
  117. LPSTR lpstrFindWhat; /* ptr. to search string */
  118. LPSTR lpstrReplaceWith; /* ptr. to replace string */
  119. UINT wFindWhatLen; /* size of find buffer */
  120. UINT wReplaceWithLen; /* size of replace buffer */
  121. LPARAM lCustData; /* data passed to hook fn. */
  122. UINT (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);
  123. /* ptr. to hook fn. or NULL */
  124. LPCSTR lpTemplateName; /* custom template name */
  125. } FINDREPLACE;
  126. typedef FINDREPLACE FAR *LPFINDREPLACE;
  127. #define FR_DOWN 0x00000001
  128. #define FR_WHOLEWORD 0x00000002
  129. #define FR_MATCHCASE 0x00000004
  130. #define FR_FINDNEXT 0x00000008
  131. #define FR_REPLACE 0x00000010
  132. #define FR_REPLACEALL 0x00000020
  133. #define FR_DIALOGTERM 0x00000040
  134. #define FR_SHOWHELP 0x00000080
  135. #define FR_ENABLEHOOK 0x00000100
  136. #define FR_ENABLETEMPLATE 0x00000200
  137. #define FR_NOUPDOWN 0x00000400
  138. #define FR_NOMATCHCASE 0x00000800
  139. #define FR_NOWHOLEWORD 0x00001000
  140. #define FR_ENABLETEMPLATEHANDLE 0x00002000
  141. #define FR_HIDEUPDOWN 0x00004000
  142. #define FR_HIDEMATCHCASE 0x00008000
  143. #define FR_HIDEWHOLEWORD 0x00010000
  144. /// 0x?0000000 is reserved for internal use
  145. HWND WINAPI FindText(FINDREPLACE FAR*);
  146. HWND WINAPI ReplaceText(FINDREPLACE FAR*);
  147. //---------------------------------------------------------------------------
  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. ///// reserved for internal use 0x?0000000L
  200. /* these are extra nFontType bits that are added to what is returned to the
  201. * EnumFonts callback routine */
  202. #define SIMULATED_FONTTYPE 0x8000
  203. #define PRINTER_FONTTYPE 0x4000
  204. #define SCREEN_FONTTYPE 0x2000
  205. #define BOLD_FONTTYPE 0x0100
  206. #define ITALIC_FONTTYPE 0x0200
  207. #define REGULAR_FONTTYPE 0x0400
  208. #define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
  209. /* strings used to obtain unique window message for communication
  210. * between dialog and caller
  211. */
  212. #define LBSELCHSTRING "commdlg_LBSelChangedNotify"
  213. #define SHAREVISTRING "commdlg_ShareViolation"
  214. #define FILEOKSTRING "commdlg_FileNameOK"
  215. #define COLOROKSTRING "commdlg_ColorOK"
  216. #define SETRGBSTRING "commdlg_SetRGBColor"
  217. #define FINDMSGSTRING "commdlg_FindReplace"
  218. #define HELPMSGSTRING "commdlg_help"
  219. /* HIWORD values for lParam of commdlg_LBSelChangeNotify message */
  220. #define CD_LBSELNOITEMS -1
  221. #define CD_LBSELCHANGE 0
  222. #define CD_LBSELSUB 1
  223. #define CD_LBSELADD 2
  224. //---------------------------------------------------------------------------
  225. typedef struct tagPD
  226. {
  227. DWORD lStructSize;
  228. HWND hwndOwner;
  229. HGLOBAL hDevMode;
  230. HGLOBAL hDevNames;
  231. HDC hDC;
  232. DWORD Flags;
  233. UINT nFromPage;
  234. UINT nToPage;
  235. UINT nMinPage;
  236. UINT nMaxPage;
  237. UINT nCopies;
  238. HINSTANCE hInstance;
  239. LPARAM lCustData;
  240. UINT (CALLBACK* lpfnPrintHook)(HWND, UINT, WPARAM, LPARAM);
  241. UINT (CALLBACK* lpfnSetupHook)(HWND, UINT, WPARAM, LPARAM);
  242. LPCSTR lpPrintTemplateName;
  243. LPCSTR lpSetupTemplateName;
  244. HGLOBAL hPrintTemplate;
  245. HGLOBAL hSetupTemplate;
  246. } PRINTDLG;
  247. typedef PRINTDLG FAR* LPPRINTDLG;
  248. BOOL WINAPI PrintDlg(PRINTDLG FAR*);
  249. #define PD_ALLPAGES 0x00000000
  250. #define PD_SELECTION 0x00000001
  251. #define PD_PAGENUMS 0x00000002
  252. #define PD_NOSELECTION 0x00000004
  253. #define PD_NOPAGENUMS 0x00000008
  254. #define PD_COLLATE 0x00000010
  255. #define PD_PRINTTOFILE 0x00000020
  256. #define PD_PRINTSETUP 0x00000040
  257. #define PD_NOWARNING 0x00000080
  258. #define PD_RETURNDC 0x00000100
  259. #define PD_RETURNIC 0x00000200
  260. #define PD_RETURNDEFAULT 0x00000400
  261. #define PD_SHOWHELP 0x00000800
  262. #define PD_ENABLEPRINTHOOK 0x00001000
  263. #define PD_ENABLESETUPHOOK 0x00002000
  264. #define PD_ENABLEPRINTTEMPLATE 0x00004000
  265. #define PD_ENABLESETUPTEMPLATE 0x00008000
  266. #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
  267. #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
  268. #define PD_USEDEVMODECOPIES 0x00040000
  269. #define PD_DISABLEPRINTTOFILE 0x00080000
  270. #define PD_HIDEPRINTTOFILE 0x00100000
  271. #define PD_NONETWORKBUTTON 0x00200000
  272. //// reserved 0x?0000000
  273. typedef struct tagDEVNAMES
  274. {
  275. UINT wDriverOffset;
  276. UINT wDeviceOffset;
  277. UINT wOutputOffset;
  278. UINT wDefault;
  279. } DEVNAMES;
  280. typedef DEVNAMES FAR* LPDEVNAMES;
  281. #define DN_DEFAULTPRN 0x0001
  282. DWORD WINAPI CommDlgExtendedError(void);
  283. //---------------------------------------------------------------------------
  284. #ifdef __cplusplus
  285. }
  286. #endif /* __cplusplus */
  287. #ifndef RC_INVOKED
  288. #pragma pack()
  289. #endif /* !RC_INVOKED */
  290. #endif /* !_INC_COMMDLG */