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.

537 lines
17 KiB

  1. /*++
  2. Copyright (c) 1992-1993 Microsoft Corporation
  3. Module Name:
  4. commdlg.h
  5. Abstract:
  6. common dialog definitions; #include <windows.h> must be precluded
  7. Revision History:
  8. --*/
  9. #ifndef _INC_COMMDLG
  10. #define _INC_COMMDLG
  11. #ifndef RC_INVOKED
  12. #pragma pack(1) /* Assume byte packing throughout */
  13. #endif /* !RC_INVOKED */
  14. #ifdef __cplusplus
  15. extern "C" { /* Assume C declarations for C++ */
  16. #endif /* __cplusplus */
  17. typedef UINT (APIENTRY *LPOFNHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  18. typedef struct tagOFNA {
  19. DWORD lStructSize;
  20. HWND hwndOwner;
  21. HINSTANCE hInstance;
  22. LPCSTR lpstrFilter;
  23. LPSTR lpstrCustomFilter;
  24. DWORD nMaxCustFilter;
  25. DWORD nFilterIndex;
  26. LPSTR lpstrFile;
  27. DWORD nMaxFile;
  28. LPSTR lpstrFileTitle;
  29. DWORD nMaxFileTitle;
  30. LPCSTR lpstrInitialDir;
  31. LPCSTR lpstrTitle;
  32. DWORD Flags;
  33. WORD nFileOffset;
  34. WORD nFileExtension;
  35. LPCSTR lpstrDefExt;
  36. LPARAM lCustData;
  37. LPOFNHOOKPROC lpfnHook;
  38. LPCSTR lpTemplateName;
  39. } OPENFILENAMEA;
  40. typedef struct tagOFNW {
  41. DWORD lStructSize;
  42. HWND hwndOwner;
  43. HINSTANCE hInstance;
  44. LPCWSTR lpstrFilter;
  45. LPWSTR lpstrCustomFilter;
  46. DWORD nMaxCustFilter;
  47. DWORD nFilterIndex;
  48. LPWSTR lpstrFile;
  49. DWORD nMaxFile;
  50. LPWSTR lpstrFileTitle;
  51. DWORD nMaxFileTitle;
  52. LPCWSTR lpstrInitialDir;
  53. LPCWSTR lpstrTitle;
  54. DWORD Flags;
  55. WORD nFileOffset;
  56. WORD nFileExtension;
  57. LPCWSTR lpstrDefExt;
  58. LPARAM lCustData;
  59. LPOFNHOOKPROC lpfnHook;
  60. LPCWSTR lpTemplateName;
  61. } OPENFILENAMEW;
  62. #ifdef UNICODE
  63. #define OPENFILENAME OPENFILENAMEW
  64. #else
  65. #define OPENFILENAME OPENFILENAMEA
  66. #endif // ! UNICODE
  67. typedef OPENFILENAMEA * LPOPENFILENAMEA;
  68. typedef OPENFILENAMEW * LPOPENFILENAMEW;
  69. typedef OPENFILENAME * LPOPENFILENAME;
  70. BOOL APIENTRY GetOpenFileNameA(LPOPENFILENAMEA);
  71. BOOL APIENTRY GetOpenFileNameW(LPOPENFILENAMEW);
  72. #ifdef UNICODE
  73. #define GetOpenFileName GetOpenFileNameW
  74. #else
  75. #define GetOpenFileName GetOpenFileNameA
  76. #endif // ! UNICODE
  77. BOOL APIENTRY GetSaveFileNameA(LPOPENFILENAMEA);
  78. BOOL APIENTRY GetSaveFileNameW(LPOPENFILENAMEW);
  79. #ifdef UNICODE
  80. #define GetSaveFileName GetSaveFileNameW
  81. #else
  82. #define GetSaveFileName GetSaveFileNameA
  83. #endif // ! UNICODE
  84. short APIENTRY GetFileTitleA(LPCSTR, LPSTR, WORD);
  85. short APIENTRY GetFileTitleW(LPCWSTR, LPWSTR, WORD);
  86. #ifdef UNICODE
  87. #define GetFileTitle GetFileTitleW
  88. #else
  89. #define GetFileTitle GetFileTitleA
  90. #endif // ! UNICODE
  91. #define OFN_READONLY 0x00000001
  92. #define OFN_OVERWRITEPROMPT 0x00000002
  93. #define OFN_HIDEREADONLY 0x00000004
  94. #define OFN_NOCHANGEDIR 0x00000008
  95. #define OFN_SHOWHELP 0x00000010
  96. #define OFN_ENABLEHOOK 0x00000020
  97. #define OFN_ENABLETEMPLATE 0x00000040
  98. #define OFN_ENABLETEMPLATEHANDLE 0x00000080
  99. #define OFN_NOVALIDATE 0x00000100
  100. #define OFN_ALLOWMULTISELECT 0x00000200
  101. #define OFN_EXTENSIONDIFFERENT 0x00000400
  102. #define OFN_PATHMUSTEXIST 0x00000800
  103. #define OFN_FILEMUSTEXIST 0x00001000
  104. #define OFN_CREATEPROMPT 0x00002000
  105. #define OFN_SHAREAWARE 0x00004000
  106. #define OFN_NOREADONLYRETURN 0x00008000
  107. #define OFN_NOTESTFILECREATE 0x00010000
  108. #define OFN_NONETWORKBUTTON 0x00020000
  109. #define OFN_NOLONGNAMES 0x00040000
  110. // Return values for the registered message sent to the hook function
  111. // when a sharing violation occurs. OFN_SHAREFALLTHROUGH allows the
  112. // filename to be accepted, OFN_SHARENOWARN rejects the name but puts
  113. // up no warning (returned when the app has already put up a warning
  114. // message), and OFN_SHAREWARN puts up the default warning message
  115. // for sharing violations.
  116. //
  117. // Note: Undefined return values map to OFN_SHAREWARN, but are
  118. // reserved for future use.
  119. #define OFN_SHAREFALLTHROUGH 2
  120. #define OFN_SHARENOWARN 1
  121. #define OFN_SHAREWARN 0
  122. typedef UINT (APIENTRY *LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  123. typedef struct tagCHOOSECOLORA {
  124. DWORD lStructSize;
  125. HWND hwndOwner;
  126. HWND hInstance;
  127. COLORREF rgbResult;
  128. COLORREF* lpCustColors;
  129. DWORD Flags;
  130. LPARAM lCustData;
  131. LPCCHOOKPROC lpfnHook;
  132. LPCSTR lpTemplateName;
  133. } CHOOSECOLORA;
  134. typedef struct tagCHOOSECOLORW {
  135. DWORD lStructSize;
  136. HWND hwndOwner;
  137. HWND hInstance;
  138. COLORREF rgbResult;
  139. COLORREF* lpCustColors;
  140. DWORD Flags;
  141. LPARAM lCustData;
  142. LPCCHOOKPROC lpfnHook;
  143. LPCWSTR lpTemplateName;
  144. } CHOOSECOLORW;
  145. #ifdef UNICODE
  146. #define CHOOSECOLOR CHOOSECOLORW
  147. #else
  148. #define CHOOSECOLOR CHOOSECOLORA
  149. #endif // ! UNICODE
  150. typedef CHOOSECOLORA *LPCHOOSECOLORA;
  151. typedef CHOOSECOLORW *LPCHOOSECOLORW;
  152. typedef CHOOSECOLOR *LPCHOOSECOLOR;
  153. BOOL APIENTRY ChooseColorA(LPCHOOSECOLORA);
  154. BOOL APIENTRY ChooseColorW(LPCHOOSECOLORW);
  155. #ifdef UNICODE
  156. #define ChooseColor ChooseColorW
  157. #else
  158. #define ChooseColor ChooseColorA
  159. #endif // ! UNICODE
  160. #define CC_RGBINIT 0x00000001
  161. #define CC_FULLOPEN 0x00000002
  162. #define CC_PREVENTFULLOPEN 0x00000004
  163. #define CC_SHOWHELP 0x00000008
  164. #define CC_ENABLEHOOK 0x00000010
  165. #define CC_ENABLETEMPLATE 0x00000020
  166. #define CC_ENABLETEMPLATEHANDLE 0x00000040
  167. typedef UINT (APIENTRY *LPFRHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  168. typedef struct tagFINDREPLACEA {
  169. DWORD lStructSize; // size of this struct 0x20
  170. HWND hwndOwner; // handle to owner's window
  171. HINSTANCE hInstance; // instance handle of.EXE that
  172. // contains cust. dlg. template
  173. DWORD Flags; // one or more of the FR_??
  174. LPSTR lpstrFindWhat; // ptr. to search string
  175. LPSTR lpstrReplaceWith; // ptr. to replace string
  176. WORD wFindWhatLen; // size of find buffer
  177. WORD wReplaceWithLen; // size of replace buffer
  178. LPARAM lCustData; // data passed to hook fn.
  179. LPFRHOOKPROC lpfnHook; // ptr. to hook fn. or NULL
  180. LPCSTR lpTemplateName; // custom template name
  181. } FINDREPLACEA;
  182. typedef struct tagFINDREPLACEW {
  183. DWORD lStructSize; // size of this struct 0x20
  184. HWND hwndOwner; // handle to owner's window
  185. HINSTANCE hInstance; // instance handle of.EXE that
  186. // contains cust. dlg. template
  187. DWORD Flags; // one or more of the FR_??
  188. LPWSTR lpstrFindWhat; // ptr. to search string
  189. LPWSTR lpstrReplaceWith; // ptr. to replace string
  190. WORD wFindWhatLen; // size of find buffer
  191. WORD wReplaceWithLen; // size of replace buffer
  192. LPARAM lCustData; // data passed to hook fn.
  193. LPFRHOOKPROC lpfnHook; // ptr. to hook fn. or NULL
  194. LPCWSTR lpTemplateName; // custom template name
  195. } FINDREPLACEW;
  196. #ifdef UNICODE
  197. #define FINDREPLACE FINDREPLACEW
  198. #else
  199. #define FINDREPLACE FINDREPLACEA
  200. #endif // ! UNICODE
  201. typedef FINDREPLACEA *LPFINDREPLACEA;
  202. typedef FINDREPLACEW *LPFINDREPLACEW;
  203. typedef FINDREPLACE *LPFINDREPLACE;
  204. #define FR_DOWN 0x00000001
  205. #define FR_WHOLEWORD 0x00000002
  206. #define FR_MATCHCASE 0x00000004
  207. #define FR_FINDNEXT 0x00000008
  208. #define FR_REPLACE 0x00000010
  209. #define FR_REPLACEALL 0x00000020
  210. #define FR_DIALOGTERM 0x00000040
  211. #define FR_SHOWHELP 0x00000080
  212. #define FR_ENABLEHOOK 0x00000100
  213. #define FR_ENABLETEMPLATE 0x00000200
  214. #define FR_NOUPDOWN 0x00000400
  215. #define FR_NOMATCHCASE 0x00000800
  216. #define FR_NOWHOLEWORD 0x00001000
  217. #define FR_ENABLETEMPLATEHANDLE 0x00002000
  218. #define FR_HIDEUPDOWN 0x00004000
  219. #define FR_HIDEMATCHCASE 0x00008000
  220. #define FR_HIDEWHOLEWORD 0x00010000
  221. HWND APIENTRY FindTextA(LPFINDREPLACEA);
  222. HWND APIENTRY FindTextW(LPFINDREPLACEW);
  223. #ifdef UNICODE
  224. #define FindText FindTextW
  225. #else
  226. #define FindText FindTextA
  227. #endif // ! UNICODE
  228. HWND APIENTRY ReplaceTextA(LPFINDREPLACEA);
  229. HWND APIENTRY ReplaceTextW(LPFINDREPLACEW);
  230. #ifdef UNICODE
  231. #define ReplaceText ReplaceTextW
  232. #else
  233. #define ReplaceText ReplaceTextA
  234. #endif // ! UNICODE
  235. typedef UINT (APIENTRY *LPCFHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  236. typedef struct tagCHOOSEFONTA {
  237. DWORD lStructSize;
  238. HWND hwndOwner; // caller's window handle
  239. HDC hDC; // printer DC/IC or NULL
  240. LPLOGFONTA lpLogFont; // ptr. to a LOGFONT struct
  241. INT iPointSize; // 10 * size in points of selected font
  242. DWORD Flags; // enum. type flags
  243. COLORREF rgbColors; // returned text color
  244. LPARAM lCustData; // data passed to hook fn.
  245. LPCFHOOKPROC lpfnHook; // ptr. to hook function
  246. LPCSTR lpTemplateName; // custom template name
  247. HINSTANCE hInstance; // instance handle of.EXE that
  248. // contains cust. dlg. template
  249. LPSTR lpszStyle; // return the style field here
  250. // must be LF_FACESIZE or bigger
  251. WORD nFontType; // same value reported to the EnumFonts
  252. // call back with the extra FONTTYPE_
  253. // bits added
  254. WORD ___MISSING_ALIGNMENT__;
  255. INT nSizeMin; // minimum pt size allowed &
  256. INT nSizeMax; // max pt size allowed if
  257. // CF_LIMITSIZE is used
  258. } CHOOSEFONTA;
  259. typedef struct tagCHOOSEFONTW {
  260. DWORD lStructSize;
  261. HWND hwndOwner; // caller's window handle
  262. HDC hDC; // printer DC/IC or NULL
  263. LPLOGFONTW lpLogFont; // ptr. to a LOGFONT struct
  264. INT iPointSize; // 10 * size in points of selected font
  265. DWORD Flags; // enum. type flags
  266. COLORREF rgbColors; // returned text color
  267. LPARAM lCustData; // data passed to hook fn.
  268. LPCFHOOKPROC lpfnHook; // ptr. to hook function
  269. LPCWSTR lpTemplateName; // custom template name
  270. HINSTANCE hInstance; // instance handle of.EXE that
  271. // contains cust. dlg. template
  272. LPWSTR lpszStyle; // return the style field here
  273. // must be LF_FACESIZE or bigger
  274. WORD nFontType; // same value reported to the EnumFonts
  275. // call back with the extra FONTTYPE_
  276. // bits added
  277. WORD ___MISSING_ALIGNMENT__;
  278. INT nSizeMin; // minimum pt size allowed &
  279. INT nSizeMax; // max pt size allowed if
  280. // CF_LIMITSIZE is used
  281. } CHOOSEFONTW;
  282. #ifdef UNICODE
  283. #define CHOOSEFONT CHOOSEFONTW
  284. #else
  285. #define CHOOSEFONT CHOOSEFONTA
  286. #endif // ! UNICODE
  287. typedef CHOOSEFONTA *LPCHOOSEFONTA;
  288. typedef CHOOSEFONTW *LPCHOOSEFONTW;
  289. typedef CHOOSEFONT *LPCHOOSEFONT;
  290. BOOL APIENTRY ChooseFontA(LPCHOOSEFONTA);
  291. BOOL APIENTRY ChooseFontW(LPCHOOSEFONTW);
  292. #ifdef UNICODE
  293. #define ChooseFont ChooseFontW
  294. #else
  295. #define ChooseFont ChooseFontA
  296. #endif // !UNICODE
  297. #define CF_SCREENFONTS 0x00000001
  298. #define CF_PRINTERFONTS 0x00000002
  299. #define CF_BOTH (CF_SCREENFONTS | CF_PRINTERFONTS)
  300. #define CF_SHOWHELP 0x00000004L
  301. #define CF_ENABLEHOOK 0x00000008L
  302. #define CF_ENABLETEMPLATE 0x00000010L
  303. #define CF_ENABLETEMPLATEHANDLE 0x00000020L
  304. #define CF_INITTOLOGFONTSTRUCT 0x00000040L
  305. #define CF_USESTYLE 0x00000080L
  306. #define CF_EFFECTS 0x00000100L
  307. #define CF_APPLY 0x00000200L
  308. #define CF_ANSIONLY 0x00000400L
  309. #define CF_NOVECTORFONTS 0x00000800L
  310. #define CF_NOOEMFONTS CF_NOVECTORFONTS
  311. #define CF_NOSIMULATIONS 0x00001000L
  312. #define CF_LIMITSIZE 0x00002000L
  313. #define CF_FIXEDPITCHONLY 0x00004000L
  314. #define CF_WYSIWYG 0x00008000L // must also have CF_SCREENFONTS & CF_PRINTERFONTS
  315. #define CF_FORCEFONTEXIST 0x00010000L
  316. #define CF_SCALABLEONLY 0x00020000L
  317. #define CF_TTONLY 0x00040000L
  318. #define CF_NOFACESEL 0x00080000L
  319. #define CF_NOSTYLESEL 0x00100000L
  320. #define CF_NOSIZESEL 0x00200000L
  321. // these are extra nFontType bits that are added to what is returned to the
  322. // EnumFonts callback routine
  323. #define SIMULATED_FONTTYPE 0x8000
  324. #define PRINTER_FONTTYPE 0x4000
  325. #define SCREEN_FONTTYPE 0x2000
  326. #define BOLD_FONTTYPE 0x0100
  327. #define ITALIC_FONTTYPE 0x0200
  328. #define REGULAR_FONTTYPE 0x0400
  329. #define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
  330. // strings used to obtain unique window message for communication
  331. // between dialog and caller
  332. #define LBSELCHSTRINGA "commdlg_LBSelChangedNotify"
  333. #define SHAREVISTRINGA "commdlg_ShareViolation"
  334. #define FILEOKSTRINGA "commdlg_FileNameOK"
  335. #define COLOROKSTRINGA "commdlg_ColorOK"
  336. #define SETRGBSTRINGA "commdlg_SetRGBColor"
  337. #define HELPMSGSTRINGA "commdlg_help"
  338. #define FINDMSGSTRINGA "commdlg_FindReplace"
  339. #define LBSELCHSTRINGW L"commdlg_LBSelChangedNotify"
  340. #define SHAREVISTRINGW L"commdlg_ShareViolation"
  341. #define FILEOKSTRINGW L"commdlg_FileNameOK"
  342. #define COLOROKSTRINGW L"commdlg_ColorOK"
  343. #define SETRGBSTRINGW L"commdlg_SetRGBColor"
  344. #define HELPMSGSTRINGW L"commdlg_help"
  345. #define FINDMSGSTRINGW L"commdlg_FindReplace"
  346. #ifdef UNICODE
  347. #define LBSELCHSTRING LBSELCHSTRINGW
  348. #define SHAREVISTRING SHAREVISTRINGW
  349. #define FILEOKSTRING FILEOKSTRINGW
  350. #define COLOROKSTRING COLOROKSTRINGW
  351. #define SETRGBSTRING SETRGBSTRINGW
  352. #define HELPMSGSTRING HELPMSGSTRINGW
  353. #define FINDMSGSTRING FINDMSGSTRINGW
  354. #else
  355. #define LBSELCHSTRING LBSELCHSTRINGA
  356. #define SHAREVISTRING SHAREVISTRINGA
  357. #define FILEOKSTRING FILEOKSTRINGA
  358. #define COLOROKSTRING COLOROKSTRINGA
  359. #define SETRGBSTRING SETRGBSTRINGA
  360. #define HELPMSGSTRING HELPMSGSTRINGA
  361. #define FINDMSGSTRING FINDMSGSTRINGA
  362. #endif
  363. // HIWORD values for lParam of commdlg_LBSelChangeNotify message
  364. #define CD_LBSELNOITEMS -1
  365. #define CD_LBSELCHANGE 0
  366. #define CD_LBSELSUB 1
  367. #define CD_LBSELADD 2
  368. typedef UINT (APIENTRY *LPPRINTHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  369. typedef UINT (APIENTRY *LPSETUPHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  370. typedef struct tagPDA {
  371. DWORD lStructSize;
  372. HWND hwndOwner;
  373. HGLOBAL hDevMode;
  374. HGLOBAL hDevNames;
  375. HDC hDC;
  376. DWORD Flags;
  377. WORD nFromPage;
  378. WORD nToPage;
  379. WORD nMinPage;
  380. WORD nMaxPage;
  381. WORD nCopies;
  382. HINSTANCE hInstance;
  383. LPARAM lCustData;
  384. LPPRINTHOOKPROC lpfnPrintHook;
  385. LPSETUPHOOKPROC lpfnSetupHook;
  386. LPCSTR lpPrintTemplateName;
  387. LPCSTR lpSetupTemplateName;
  388. HGLOBAL hPrintTemplate;
  389. HGLOBAL hSetupTemplate;
  390. } PRINTDLGA;
  391. typedef struct tagPDW {
  392. DWORD lStructSize;
  393. HWND hwndOwner;
  394. HGLOBAL hDevMode;
  395. HGLOBAL hDevNames;
  396. HDC hDC;
  397. DWORD Flags;
  398. WORD nFromPage;
  399. WORD nToPage;
  400. WORD nMinPage;
  401. WORD nMaxPage;
  402. WORD nCopies;
  403. HINSTANCE hInstance;
  404. LPARAM lCustData;
  405. LPPRINTHOOKPROC lpfnPrintHook;
  406. LPSETUPHOOKPROC lpfnSetupHook;
  407. LPCWSTR lpPrintTemplateName;
  408. LPCWSTR lpSetupTemplateName;
  409. HGLOBAL hPrintTemplate;
  410. HGLOBAL hSetupTemplate;
  411. } PRINTDLGW;
  412. #ifdef UNICODE
  413. #define PRINTDLG PRINTDLGW
  414. #else
  415. #define PRINTDLG PRINTDLGA
  416. #endif // ! UNICODE
  417. typedef PRINTDLGA * LPPRINTDLGA;
  418. typedef PRINTDLGW * LPPRINTDLGW;
  419. typedef PRINTDLG * LPPRINTDLG;
  420. BOOL APIENTRY PrintDlgA(LPPRINTDLGA);
  421. BOOL APIENTRY PrintDlgW(LPPRINTDLGW);
  422. #ifdef UNICODE
  423. #define PrintDlg PrintDlgW
  424. #else
  425. #define PrintDlg PrintDlgA
  426. #endif // ! UNICODE
  427. #define PD_ALLPAGES 0x00000000
  428. #define PD_SELECTION 0x00000001
  429. #define PD_PAGENUMS 0x00000002
  430. #define PD_NOSELECTION 0x00000004
  431. #define PD_NOPAGENUMS 0x00000008
  432. #define PD_COLLATE 0x00000010
  433. #define PD_PRINTTOFILE 0x00000020
  434. #define PD_PRINTSETUP 0x00000040
  435. #define PD_NOWARNING 0x00000080
  436. #define PD_RETURNDC 0x00000100
  437. #define PD_RETURNIC 0x00000200
  438. #define PD_RETURNDEFAULT 0x00000400
  439. #define PD_SHOWHELP 0x00000800
  440. #define PD_ENABLEPRINTHOOK 0x00001000
  441. #define PD_ENABLESETUPHOOK 0x00002000
  442. #define PD_ENABLEPRINTTEMPLATE 0x00004000
  443. #define PD_ENABLESETUPTEMPLATE 0x00008000
  444. #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
  445. #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
  446. #define PD_USEDEVMODECOPIES 0x00040000
  447. #define PD_DISABLEPRINTTOFILE 0x00080000
  448. #define PD_HIDEPRINTTOFILE 0x00100000
  449. #define PD_NONETWORKBUTTON 0x00200000
  450. typedef struct tagDEVNAMES {
  451. WORD wDriverOffset;
  452. WORD wDeviceOffset;
  453. WORD wOutputOffset;
  454. WORD wDefault;
  455. } DEVNAMES;
  456. typedef DEVNAMES * LPDEVNAMES;
  457. #define DN_DEFAULTPRN 0x0001
  458. DWORD APIENTRY CommDlgExtendedError(VOID);
  459. #ifdef __cplusplus
  460. }
  461. #endif /* __cplusplus */
  462. #ifndef RC_INVOKED
  463. #pragma pack()
  464. #endif /* !RC_INVOKED */
  465. #endif /* !_INC_COMMDLG */
  466.