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.

791 lines
28 KiB

  1. /************************************************************************
  2. * *
  3. * commdlg.h -- This module defines the 32-Bit Common Dialog APIs *
  4. * *
  5. * Copyright (c) 1992-1995, Microsoft Corp. All rights reserved. *
  6. * *
  7. ************************************************************************/
  8. #ifndef _INC_COMMDLG
  9. #define _INC_COMMDLG
  10. #include <pshpack1.h> /* Assume byte packing throughout */
  11. #ifdef __cplusplus
  12. extern "C" { /* Assume C declarations for C++ */
  13. #endif /* __cplusplus */
  14. #if(WINVER >= 0x0400)
  15. #ifdef __cplusplus
  16. #define SNDMSG ::SendMessage
  17. #else /* __cplusplus */
  18. #define SNDMSG SendMessage
  19. #endif /* __cplusplus */
  20. #endif /* WINVER >= 0x0400 */
  21. typedef UINT (APIENTRY *LPOFNHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  22. #ifndef UNICODE_ONLY
  23. typedef struct tagOFNA {
  24. DWORD lStructSize;
  25. HWND hwndOwner;
  26. HINSTANCE hInstance;
  27. LPCSTR lpstrFilter;
  28. LPSTR lpstrCustomFilter;
  29. DWORD nMaxCustFilter;
  30. DWORD nFilterIndex;
  31. LPSTR lpstrFile;
  32. DWORD nMaxFile;
  33. LPSTR lpstrFileTitle;
  34. DWORD nMaxFileTitle;
  35. LPCSTR lpstrInitialDir;
  36. LPCSTR lpstrTitle;
  37. DWORD Flags;
  38. WORD nFileOffset;
  39. WORD nFileExtension;
  40. LPCSTR lpstrDefExt;
  41. LPARAM lCustData;
  42. LPOFNHOOKPROC lpfnHook;
  43. LPCSTR lpTemplateName;
  44. } OPENFILENAMEA, *LPOPENFILENAMEA;
  45. #endif //!UNICODE_ONLY
  46. #ifndef ANSI_ONLY
  47. typedef struct tagOFNW {
  48. DWORD lStructSize;
  49. HWND hwndOwner;
  50. HINSTANCE hInstance;
  51. LPCWSTR lpstrFilter;
  52. LPWSTR lpstrCustomFilter;
  53. DWORD nMaxCustFilter;
  54. DWORD nFilterIndex;
  55. LPWSTR lpstrFile;
  56. DWORD nMaxFile;
  57. LPWSTR lpstrFileTitle;
  58. DWORD nMaxFileTitle;
  59. LPCWSTR lpstrInitialDir;
  60. LPCWSTR lpstrTitle;
  61. DWORD Flags;
  62. WORD nFileOffset;
  63. WORD nFileExtension;
  64. LPCWSTR lpstrDefExt;
  65. LPARAM lCustData;
  66. LPOFNHOOKPROC lpfnHook;
  67. LPCWSTR lpTemplateName;
  68. } OPENFILENAMEW, *LPOPENFILENAMEW;
  69. #endif //!ANSI_ONLY
  70. #ifdef UNICODE
  71. typedef OPENFILENAMEW OPENFILENAME;
  72. typedef LPOPENFILENAMEW LPOPENFILENAME;
  73. #else
  74. typedef OPENFILENAMEA OPENFILENAME;
  75. typedef LPOPENFILENAMEA LPOPENFILENAME;
  76. #endif // UNICODE
  77. #ifndef UNICODE_ONLY
  78. BOOL APIENTRY GetOpenFileNameA(LPOPENFILENAMEA);
  79. #endif //!UNICODE_ONLY
  80. #ifndef ANSI_ONLY
  81. BOOL APIENTRY GetOpenFileNameW(LPOPENFILENAMEW);
  82. #endif //!ANSI_ONLY
  83. #ifdef UNICODE
  84. #define GetOpenFileName GetOpenFileNameW
  85. #else
  86. #define GetOpenFileName GetOpenFileNameA
  87. #endif // !UNICODE
  88. #ifndef UNICODE_ONLY
  89. BOOL APIENTRY GetSaveFileNameA(LPOPENFILENAMEA);
  90. #endif //!UNICODE_ONLY
  91. #ifndef ANSI_ONLY
  92. BOOL APIENTRY GetSaveFileNameW(LPOPENFILENAMEW);
  93. #endif //!ANSI_ONLY
  94. #ifdef UNICODE
  95. #define GetSaveFileName GetSaveFileNameW
  96. #else
  97. #define GetSaveFileName GetSaveFileNameA
  98. #endif // !UNICODE
  99. #ifndef UNICODE_ONLY
  100. short APIENTRY GetFileTitleA(LPCSTR, LPSTR, WORD);
  101. #endif //!UNICODE_ONLY
  102. #ifndef ANSI_ONLY
  103. short APIENTRY GetFileTitleW(LPCWSTR, LPWSTR, WORD);
  104. #endif //!ANSI_ONLY
  105. #ifdef UNICODE
  106. #define GetFileTitle GetFileTitleW
  107. #else
  108. #define GetFileTitle GetFileTitleA
  109. #endif // !UNICODE
  110. #define OFN_READONLY 0x00000001
  111. #define OFN_OVERWRITEPROMPT 0x00000002
  112. #define OFN_HIDEREADONLY 0x00000004
  113. #define OFN_NOCHANGEDIR 0x00000008
  114. #define OFN_SHOWHELP 0x00000010
  115. #define OFN_ENABLEHOOK 0x00000020
  116. #define OFN_ENABLETEMPLATE 0x00000040
  117. #define OFN_ENABLETEMPLATEHANDLE 0x00000080
  118. #define OFN_NOVALIDATE 0x00000100
  119. #define OFN_ALLOWMULTISELECT 0x00000200
  120. #define OFN_EXTENSIONDIFFERENT 0x00000400
  121. #define OFN_PATHMUSTEXIST 0x00000800
  122. #define OFN_FILEMUSTEXIST 0x00001000
  123. #define OFN_CREATEPROMPT 0x00002000
  124. #define OFN_SHAREAWARE 0x00004000
  125. #define OFN_NOREADONLYRETURN 0x00008000
  126. #define OFN_NOTESTFILECREATE 0x00010000
  127. #define OFN_NONETWORKBUTTON 0x00020000
  128. #define OFN_NOLONGNAMES 0x00040000 // force no long names for 4.x modules
  129. #if(WINVER >= 0x0400)
  130. #define OFN_EXPLORER 0x00080000 // new look commdlg
  131. #define OFN_NODEREFERENCELINKS 0x00100000
  132. #define OFN_LONGNAMES 0x00200000 // force long names for 3.x modules
  133. #endif /* WINVER >= 0x0400 */
  134. // Return values for the registered message sent to the hook function
  135. // when a sharing violation occurs. OFN_SHAREFALLTHROUGH allows the
  136. // filename to be accepted, OFN_SHARENOWARN rejects the name but puts
  137. // up no warning (returned when the app has already put up a warning
  138. // message), and OFN_SHAREWARN puts up the default warning message
  139. // for sharing violations.
  140. //
  141. // Note: Undefined return values map to OFN_SHAREWARN, but are
  142. // reserved for future use.
  143. #define OFN_SHAREFALLTHROUGH 2
  144. #define OFN_SHARENOWARN 1
  145. #define OFN_SHAREWARN 0
  146. typedef UINT (APIENTRY *LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  147. #if(WINVER >= 0x0400)
  148. // Structure used for all OpenFileName notifications
  149. #ifndef UNICODE_ONLY
  150. typedef struct _OFNOTIFYA
  151. {
  152. NMHDR hdr;
  153. LPOPENFILENAMEA lpOFN;
  154. LPSTR pszFile; // May be NULL
  155. } OFNOTIFYA, FAR *LPOFNOTIFYA;
  156. #endif //!UNICODE_ONLY
  157. // Structure used for all OpenFileName notifications
  158. #ifndef ANSI_ONLY
  159. typedef struct _OFNOTIFYW
  160. {
  161. NMHDR hdr;
  162. LPOPENFILENAMEW lpOFN;
  163. LPWSTR pszFile; // May be NULL
  164. } OFNOTIFYW, FAR *LPOFNOTIFYW;
  165. #endif //!ANSI_ONLY
  166. #ifdef UNICODE
  167. typedef OFNOTIFYW OFNOTIFY;
  168. typedef LPOFNOTIFYW LPOFNOTIFY;
  169. #else
  170. typedef OFNOTIFYA OFNOTIFY;
  171. typedef LPOFNOTIFYA LPOFNOTIFY;
  172. #endif // UNICODE
  173. #define CDN_FIRST (0U-601U)
  174. #define CDN_LAST (0U-699U)
  175. // Notifications when Open or Save dialog status changes
  176. #define CDN_INITDONE (CDN_FIRST - 0x0000)
  177. #define CDN_SELCHANGE (CDN_FIRST - 0x0001)
  178. #define CDN_FOLDERCHANGE (CDN_FIRST - 0x0002)
  179. #define CDN_SHAREVIOLATION (CDN_FIRST - 0x0003)
  180. #define CDN_HELP (CDN_FIRST - 0x0004)
  181. #define CDN_FILEOK (CDN_FIRST - 0x0005)
  182. #define CDN_TYPECHANGE (CDN_FIRST - 0x0006)
  183. #define CDM_FIRST (WM_USER + 100)
  184. #define CDM_LAST (WM_USER + 200)
  185. // Messages to query information from the Open or Save dialogs
  186. // lParam = pointer to text buffer that gets filled in
  187. // wParam = max number of characters of the text buffer (including NULL)
  188. // return = < 0 if error; number of characters needed (including NULL)
  189. #define CDM_GETSPEC (CDM_FIRST + 0x0000)
  190. #ifndef UNICODE_ONLY
  191. #define CommDlg_OpenSave_GetSpecA(_hdlg, _psz, _cbmax) \
  192. (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  193. #endif //!UNICODE_ONLY
  194. #ifndef ANSI_ONLY
  195. #define CommDlg_OpenSave_GetSpecW(_hdlg, _psz, _cbmax) \
  196. (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  197. #endif //!ANSI_ONLY
  198. #ifdef UNICODE
  199. #define CommDlg_OpenSave_GetSpec CommDlg_OpenSave_GetSpecW
  200. #else
  201. #define CommDlg_OpenSave_GetSpec CommDlg_OpenSave_GetSpecA
  202. #endif // !UNICODE
  203. // lParam = pointer to text buffer that gets filled in
  204. // wParam = max number of characters of the text buffer (including NULL)
  205. // return = < 0 if error; number of characters needed (including NULL)
  206. #define CDM_GETFILEPATH (CDM_FIRST + 0x0001)
  207. #ifndef UNICODE_ONLY
  208. #define CommDlg_OpenSave_GetFilePathA(_hdlg, _psz, _cbmax) \
  209. (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  210. #endif //!UNICODE_ONLY
  211. #ifndef ANSI_ONLY
  212. #define CommDlg_OpenSave_GetFilePathW(_hdlg, _psz, _cbmax) \
  213. (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  214. #endif //!ANSI_ONLY
  215. #ifdef UNICODE
  216. #define CommDlg_OpenSave_GetFilePath CommDlg_OpenSave_GetFilePathW
  217. #else
  218. #define CommDlg_OpenSave_GetFilePath CommDlg_OpenSave_GetFilePathA
  219. #endif // !UNICODE
  220. // lParam = pointer to text buffer that gets filled in
  221. // wParam = max number of characters of the text buffer (including NULL)
  222. // return = < 0 if error; number of characters needed (including NULL)
  223. #define CDM_GETFOLDERPATH (CDM_FIRST + 0x0002)
  224. #ifndef UNICODE_ONLY
  225. #define CommDlg_OpenSave_GetFolderPathA(_hdlg, _psz, _cbmax) \
  226. (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
  227. #endif //!UNICODE_ONLY
  228. #ifndef ANSI_ONLY
  229. #define CommDlg_OpenSave_GetFolderPathW(_hdlg, _psz, _cbmax) \
  230. (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
  231. #endif //!ANSI_ONLY
  232. #ifdef UNICODE
  233. #define CommDlg_OpenSave_GetFolderPath CommDlg_OpenSave_GetFolderPathW
  234. #else
  235. #define CommDlg_OpenSave_GetFolderPath CommDlg_OpenSave_GetFolderPathA
  236. #endif // !UNICODE
  237. // lParam = pointer to ITEMIDLIST buffer that gets filled in
  238. // wParam = size of the ITEMIDLIST buffer
  239. // return = < 0 if error; length of buffer needed
  240. #define CDM_GETFOLDERIDLIST (CDM_FIRST + 0x0003)
  241. #define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) \
  242. (int)SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl)
  243. // lParam = pointer to a string
  244. // wParam = ID of control to change
  245. // return = not used
  246. #define CDM_SETCONTROLTEXT (CDM_FIRST + 0x0004)
  247. #define CommDlg_OpenSave_SetControlText(_hdlg, _id, _text) \
  248. (void)SNDMSG(_hdlg, CDM_SETCONTROLTEXT, (WPARAM)_id, (LPARAM)(LPSTR)_text)
  249. // lParam = not used
  250. // wParam = ID of control to change
  251. // return = not used
  252. #define CDM_HIDECONTROL (CDM_FIRST + 0x0005)
  253. #define CommDlg_OpenSave_HideControl(_hdlg, _id) \
  254. (void)SNDMSG(_hdlg, CDM_HIDECONTROL, (WPARAM)_id, 0)
  255. // lParam = pointer to default extension (no dot)
  256. // wParam = not used
  257. // return = not used
  258. #define CDM_SETDEFEXT (CDM_FIRST + 0x0006)
  259. #define CommDlg_OpenSave_SetDefExt(_hdlg, _pszext) \
  260. (void)SNDMSG(_hdlg, CDM_SETDEFEXT, 0, (LPARAM)(LPSTR)_pszext)
  261. #endif /* WINVER >= 0x0400 */
  262. #ifndef UNICODE_ONLY
  263. typedef struct tagCHOOSECOLORA {
  264. DWORD lStructSize;
  265. HWND hwndOwner;
  266. HWND hInstance;
  267. COLORREF rgbResult;
  268. COLORREF* lpCustColors;
  269. DWORD Flags;
  270. LPARAM lCustData;
  271. LPCCHOOKPROC lpfnHook;
  272. LPCSTR lpTemplateName;
  273. } CHOOSECOLORA, *LPCHOOSECOLORA;
  274. #endif //!UNICODE_ONLY
  275. #ifndef ANSI_ONLY
  276. typedef struct tagCHOOSECOLORW {
  277. DWORD lStructSize;
  278. HWND hwndOwner;
  279. HWND hInstance;
  280. COLORREF rgbResult;
  281. COLORREF* lpCustColors;
  282. DWORD Flags;
  283. LPARAM lCustData;
  284. LPCCHOOKPROC lpfnHook;
  285. LPCWSTR lpTemplateName;
  286. } CHOOSECOLORW, *LPCHOOSECOLORW;
  287. #endif //!ANSI_ONLY
  288. #ifdef UNICODE
  289. typedef CHOOSECOLORW CHOOSECOLOR;
  290. typedef LPCHOOSECOLORW LPCHOOSECOLOR;
  291. #else
  292. typedef CHOOSECOLORA CHOOSECOLOR;
  293. typedef LPCHOOSECOLORA LPCHOOSECOLOR;
  294. #endif // UNICODE
  295. #ifndef UNICODE_ONLY
  296. BOOL APIENTRY ChooseColorA(LPCHOOSECOLORA);
  297. #endif //!UNICODE_ONLY
  298. #ifndef ANSI_ONLY
  299. BOOL APIENTRY ChooseColorW(LPCHOOSECOLORW);
  300. #endif //!ANSI_ONLY
  301. #ifdef UNICODE
  302. #define ChooseColor ChooseColorW
  303. #else
  304. #define ChooseColor ChooseColorA
  305. #endif // !UNICODE
  306. #define CC_RGBINIT 0x00000001
  307. #define CC_FULLOPEN 0x00000002
  308. #define CC_PREVENTFULLOPEN 0x00000004
  309. #define CC_SHOWHELP 0x00000008
  310. #define CC_ENABLEHOOK 0x00000010
  311. #define CC_ENABLETEMPLATE 0x00000020
  312. #define CC_ENABLETEMPLATEHANDLE 0x00000040
  313. #if(WINVER >= 0x0400)
  314. #define CC_SOLIDCOLOR 0x00000080
  315. #define CC_ANYCOLOR 0x00000100
  316. #endif /* WINVER >= 0x0400 */
  317. typedef UINT (APIENTRY *LPFRHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  318. #ifndef UNICODE_ONLY
  319. typedef struct tagFINDREPLACEA {
  320. DWORD lStructSize; // size of this struct 0x20
  321. HWND hwndOwner; // handle to owner's window
  322. HINSTANCE hInstance; // instance handle of.EXE that
  323. // contains cust. dlg. template
  324. DWORD Flags; // one or more of the FR_??
  325. LPSTR lpstrFindWhat; // ptr. to search string
  326. LPSTR lpstrReplaceWith; // ptr. to replace string
  327. WORD wFindWhatLen; // size of find buffer
  328. WORD wReplaceWithLen; // size of replace buffer
  329. LPARAM lCustData; // data passed to hook fn.
  330. LPFRHOOKPROC lpfnHook; // ptr. to hook fn. or NULL
  331. LPCSTR lpTemplateName; // custom template name
  332. } FINDREPLACEA, *LPFINDREPLACEA;
  333. #endif //!UNICODE_ONLY
  334. #ifndef ANSI_ONLY
  335. typedef struct tagFINDREPLACEW {
  336. DWORD lStructSize; // size of this struct 0x20
  337. HWND hwndOwner; // handle to owner's window
  338. HINSTANCE hInstance; // instance handle of.EXE that
  339. // contains cust. dlg. template
  340. DWORD Flags; // one or more of the FR_??
  341. LPWSTR lpstrFindWhat; // ptr. to search string
  342. LPWSTR lpstrReplaceWith; // ptr. to replace string
  343. WORD wFindWhatLen; // size of find buffer
  344. WORD wReplaceWithLen; // size of replace buffer
  345. LPARAM lCustData; // data passed to hook fn.
  346. LPFRHOOKPROC lpfnHook; // ptr. to hook fn. or NULL
  347. LPCWSTR lpTemplateName; // custom template name
  348. } FINDREPLACEW, *LPFINDREPLACEW;
  349. #endif //!ANSI_ONLY
  350. #ifdef UNICODE
  351. typedef FINDREPLACEW FINDREPLACE;
  352. typedef LPFINDREPLACEW LPFINDREPLACE;
  353. #else
  354. typedef FINDREPLACEA FINDREPLACE;
  355. typedef LPFINDREPLACEA LPFINDREPLACE;
  356. #endif // UNICODE
  357. #define FR_DOWN 0x00000001
  358. #define FR_WHOLEWORD 0x00000002
  359. #define FR_MATCHCASE 0x00000004
  360. #define FR_FINDNEXT 0x00000008
  361. #define FR_REPLACE 0x00000010
  362. #define FR_REPLACEALL 0x00000020
  363. #define FR_DIALOGTERM 0x00000040
  364. #define FR_SHOWHELP 0x00000080
  365. #define FR_ENABLEHOOK 0x00000100
  366. #define FR_ENABLETEMPLATE 0x00000200
  367. #define FR_NOUPDOWN 0x00000400
  368. #define FR_NOMATCHCASE 0x00000800
  369. #define FR_NOWHOLEWORD 0x00001000
  370. #define FR_ENABLETEMPLATEHANDLE 0x00002000
  371. #define FR_HIDEUPDOWN 0x00004000
  372. #define FR_HIDEMATCHCASE 0x00008000
  373. #define FR_HIDEWHOLEWORD 0x00010000
  374. #ifndef UNICODE_ONLY
  375. HWND APIENTRY FindTextA(LPFINDREPLACEA);
  376. #endif //!UNICODE_ONLY
  377. #ifndef ANSI_ONLY
  378. HWND APIENTRY FindTextW(LPFINDREPLACEW);
  379. #endif //!ANSI_ONLY
  380. #ifdef UNICODE
  381. #define FindText FindTextW
  382. #else
  383. #define FindText FindTextA
  384. #endif // !UNICODE
  385. #ifndef UNICODE_ONLY
  386. HWND APIENTRY ReplaceTextA(LPFINDREPLACEA);
  387. #endif //!UNICODE_ONLY
  388. #ifndef ANSI_ONLY
  389. HWND APIENTRY ReplaceTextW(LPFINDREPLACEW);
  390. #endif //!ANSI_ONLY
  391. #ifdef UNICODE
  392. #define ReplaceText ReplaceTextW
  393. #else
  394. #define ReplaceText ReplaceTextA
  395. #endif // !UNICODE
  396. typedef UINT (APIENTRY *LPCFHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  397. #ifndef UNICODE_ONLY
  398. typedef struct tagCHOOSEFONTA {
  399. DWORD lStructSize;
  400. HWND hwndOwner; // caller's window handle
  401. HDC hDC; // printer DC/IC or NULL
  402. LPLOGFONTA lpLogFont; // ptr. to a LOGFONT struct
  403. INT iPointSize; // 10 * size in points of selected font
  404. DWORD Flags; // enum. type flags
  405. COLORREF rgbColors; // returned text color
  406. LPARAM lCustData; // data passed to hook fn.
  407. LPCFHOOKPROC lpfnHook; // ptr. to hook function
  408. LPCSTR lpTemplateName; // custom template name
  409. HINSTANCE hInstance; // instance handle of.EXE that
  410. // contains cust. dlg. template
  411. LPSTR lpszStyle; // return the style field here
  412. // must be LF_FACESIZE or bigger
  413. WORD nFontType; // same value reported to the EnumFonts
  414. // call back with the extra FONTTYPE_
  415. // bits added
  416. WORD ___MISSING_ALIGNMENT__;
  417. INT nSizeMin; // minimum pt size allowed &
  418. INT nSizeMax; // max pt size allowed if
  419. // CF_LIMITSIZE is used
  420. } CHOOSEFONTA, *LPCHOOSEFONTA;
  421. #endif //!UNICODE_ONLY
  422. #ifndef ANSI_ONLY
  423. typedef struct tagCHOOSEFONTW {
  424. DWORD lStructSize;
  425. HWND hwndOwner; // caller's window handle
  426. HDC hDC; // printer DC/IC or NULL
  427. LPLOGFONTW lpLogFont; // ptr. to a LOGFONT struct
  428. INT iPointSize; // 10 * size in points of selected font
  429. DWORD Flags; // enum. type flags
  430. COLORREF rgbColors; // returned text color
  431. LPARAM lCustData; // data passed to hook fn.
  432. LPCFHOOKPROC lpfnHook; // ptr. to hook function
  433. LPCWSTR lpTemplateName; // custom template name
  434. HINSTANCE hInstance; // instance handle of.EXE that
  435. // contains cust. dlg. template
  436. LPWSTR lpszStyle; // return the style field here
  437. // must be LF_FACESIZE or bigger
  438. WORD nFontType; // same value reported to the EnumFonts
  439. // call back with the extra FONTTYPE_
  440. // bits added
  441. WORD ___MISSING_ALIGNMENT__;
  442. INT nSizeMin; // minimum pt size allowed &
  443. INT nSizeMax; // max pt size allowed if
  444. // CF_LIMITSIZE is used
  445. } CHOOSEFONTW, *LPCHOOSEFONTW;
  446. #endif //!ANSI_ONLY
  447. #ifdef UNICODE
  448. typedef CHOOSEFONTW CHOOSEFONT;
  449. typedef LPCHOOSEFONTW LPCHOOSEFONT;
  450. #else
  451. typedef CHOOSEFONTA CHOOSEFONT;
  452. typedef LPCHOOSEFONTA LPCHOOSEFONT;
  453. #endif // UNICODE
  454. #ifndef UNICODE_ONLY
  455. BOOL APIENTRY ChooseFontA(LPCHOOSEFONTA);
  456. #endif //!UNICODE_ONLY
  457. #ifndef ANSI_ONLY
  458. BOOL APIENTRY ChooseFontW(LPCHOOSEFONTW);
  459. #endif //!ANSI_ONLY
  460. #ifdef UNICODE
  461. #define ChooseFont ChooseFontW
  462. #else
  463. #define ChooseFont ChooseFontA
  464. #endif // !UNICODE
  465. #define CF_SCREENFONTS 0x00000001
  466. #define CF_PRINTERFONTS 0x00000002
  467. #define CF_BOTH (CF_SCREENFONTS | CF_PRINTERFONTS)
  468. #define CF_SHOWHELP 0x00000004L
  469. #define CF_ENABLEHOOK 0x00000008L
  470. #define CF_ENABLETEMPLATE 0x00000010L
  471. #define CF_ENABLETEMPLATEHANDLE 0x00000020L
  472. #define CF_INITTOLOGFONTSTRUCT 0x00000040L
  473. #define CF_USESTYLE 0x00000080L
  474. #define CF_EFFECTS 0x00000100L
  475. #define CF_APPLY 0x00000200L
  476. #define CF_ANSIONLY 0x00000400L
  477. #if(WINVER >= 0x0400)
  478. #define CF_SCRIPTSONLY CF_ANSIONLY
  479. #endif /* WINVER >= 0x0400 */
  480. #define CF_NOVECTORFONTS 0x00000800L
  481. #define CF_NOOEMFONTS CF_NOVECTORFONTS
  482. #define CF_NOSIMULATIONS 0x00001000L
  483. #define CF_LIMITSIZE 0x00002000L
  484. #define CF_FIXEDPITCHONLY 0x00004000L
  485. #define CF_WYSIWYG 0x00008000L // must also have CF_SCREENFONTS & CF_PRINTERFONTS
  486. #define CF_FORCEFONTEXIST 0x00010000L
  487. #define CF_SCALABLEONLY 0x00020000L
  488. #define CF_TTONLY 0x00040000L
  489. #define CF_NOFACESEL 0x00080000L
  490. #define CF_NOSTYLESEL 0x00100000L
  491. #define CF_NOSIZESEL 0x00200000L
  492. #if(WINVER >= 0x0400)
  493. #define CF_SELECTSCRIPT 0x00400000L
  494. #define CF_NOSCRIPTSEL 0x00800000L
  495. #define CF_NOVERTFONTS 0x01000000L
  496. #endif /* WINVER >= 0x0400 */
  497. // these are extra nFontType bits that are added to what is returned to the
  498. // EnumFonts callback routine
  499. #define SIMULATED_FONTTYPE 0x8000
  500. #define PRINTER_FONTTYPE 0x4000
  501. #define SCREEN_FONTTYPE 0x2000
  502. #define BOLD_FONTTYPE 0x0100
  503. #define ITALIC_FONTTYPE 0x0200
  504. #define REGULAR_FONTTYPE 0x0400
  505. #define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
  506. #define WM_CHOOSEFONT_SETLOGFONT (WM_USER + 101)
  507. #define WM_CHOOSEFONT_SETFLAGS (WM_USER + 102)
  508. // strings used to obtain unique window message for communication
  509. // between dialog and caller
  510. #define LBSELCHSTRINGA "commdlg_LBSelChangedNotify"
  511. #define SHAREVISTRINGA "commdlg_ShareViolation"
  512. #define FILEOKSTRINGA "commdlg_FileNameOK"
  513. #define COLOROKSTRINGA "commdlg_ColorOK"
  514. #define SETRGBSTRINGA "commdlg_SetRGBColor"
  515. #define HELPMSGSTRINGA "commdlg_help"
  516. #define FINDMSGSTRINGA "commdlg_FindReplace"
  517. #define LBSELCHSTRINGW L"commdlg_LBSelChangedNotify"
  518. #define SHAREVISTRINGW L"commdlg_ShareViolation"
  519. #define FILEOKSTRINGW L"commdlg_FileNameOK"
  520. #define COLOROKSTRINGW L"commdlg_ColorOK"
  521. #define SETRGBSTRINGW L"commdlg_SetRGBColor"
  522. #define HELPMSGSTRINGW L"commdlg_help"
  523. #define FINDMSGSTRINGW L"commdlg_FindReplace"
  524. #ifdef UNICODE
  525. #define LBSELCHSTRING LBSELCHSTRINGW
  526. #define SHAREVISTRING SHAREVISTRINGW
  527. #define FILEOKSTRING FILEOKSTRINGW
  528. #define COLOROKSTRING COLOROKSTRINGW
  529. #define SETRGBSTRING SETRGBSTRINGW
  530. #define HELPMSGSTRING HELPMSGSTRINGW
  531. #define FINDMSGSTRING FINDMSGSTRINGW
  532. #else
  533. #define LBSELCHSTRING LBSELCHSTRINGA
  534. #define SHAREVISTRING SHAREVISTRINGA
  535. #define FILEOKSTRING FILEOKSTRINGA
  536. #define COLOROKSTRING COLOROKSTRINGA
  537. #define SETRGBSTRING SETRGBSTRINGA
  538. #define HELPMSGSTRING HELPMSGSTRINGA
  539. #define FINDMSGSTRING FINDMSGSTRINGA
  540. #endif
  541. // HIWORD values for lParam of commdlg_LBSelChangeNotify message
  542. #define CD_LBSELNOITEMS -1
  543. #define CD_LBSELCHANGE 0
  544. #define CD_LBSELSUB 1
  545. #define CD_LBSELADD 2
  546. typedef UINT (APIENTRY *LPPRINTHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  547. typedef UINT (APIENTRY *LPSETUPHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  548. #ifndef UNICODE_ONLY
  549. typedef struct tagPDA {
  550. DWORD lStructSize;
  551. HWND hwndOwner;
  552. HGLOBAL hDevMode;
  553. HGLOBAL hDevNames;
  554. HDC hDC;
  555. DWORD Flags;
  556. WORD nFromPage;
  557. WORD nToPage;
  558. WORD nMinPage;
  559. WORD nMaxPage;
  560. WORD nCopies;
  561. HINSTANCE hInstance;
  562. LPARAM lCustData;
  563. LPPRINTHOOKPROC lpfnPrintHook;
  564. LPSETUPHOOKPROC lpfnSetupHook;
  565. LPCSTR lpPrintTemplateName;
  566. LPCSTR lpSetupTemplateName;
  567. HGLOBAL hPrintTemplate;
  568. HGLOBAL hSetupTemplate;
  569. } PRINTDLGA, *LPPRINTDLGA;
  570. #endif //!UNICODE_ONLY
  571. #ifndef ANSI_ONLY
  572. typedef struct tagPDW {
  573. DWORD lStructSize;
  574. HWND hwndOwner;
  575. HGLOBAL hDevMode;
  576. HGLOBAL hDevNames;
  577. HDC hDC;
  578. DWORD Flags;
  579. WORD nFromPage;
  580. WORD nToPage;
  581. WORD nMinPage;
  582. WORD nMaxPage;
  583. WORD nCopies;
  584. HINSTANCE hInstance;
  585. LPARAM lCustData;
  586. LPPRINTHOOKPROC lpfnPrintHook;
  587. LPSETUPHOOKPROC lpfnSetupHook;
  588. LPCWSTR lpPrintTemplateName;
  589. LPCWSTR lpSetupTemplateName;
  590. HGLOBAL hPrintTemplate;
  591. HGLOBAL hSetupTemplate;
  592. } PRINTDLGW, *LPPRINTDLGW;
  593. #endif //!ANSI_ONLY
  594. #ifdef UNICODE
  595. typedef PRINTDLGW PRINTDLG;
  596. typedef LPPRINTDLGW LPPRINTDLG;
  597. #else
  598. typedef PRINTDLGA PRINTDLG;
  599. typedef LPPRINTDLGA LPPRINTDLG;
  600. #endif // UNICODE
  601. #ifndef UNICODE_ONLY
  602. BOOL APIENTRY PrintDlgA(LPPRINTDLGA);
  603. #endif //!UNICODE_ONLY
  604. #ifndef ANSI_ONLY
  605. BOOL APIENTRY PrintDlgW(LPPRINTDLGW);
  606. #endif //!ANSI_ONLY
  607. #ifdef UNICODE
  608. #define PrintDlg PrintDlgW
  609. #else
  610. #define PrintDlg PrintDlgA
  611. #endif // !UNICODE
  612. #define PD_ALLPAGES 0x00000000
  613. #define PD_SELECTION 0x00000001
  614. #define PD_PAGENUMS 0x00000002
  615. #define PD_NOSELECTION 0x00000004
  616. #define PD_NOPAGENUMS 0x00000008
  617. #define PD_COLLATE 0x00000010
  618. #define PD_PRINTTOFILE 0x00000020
  619. #define PD_PRINTSETUP 0x00000040
  620. #define PD_NOWARNING 0x00000080
  621. #define PD_RETURNDC 0x00000100
  622. #define PD_RETURNIC 0x00000200
  623. #define PD_RETURNDEFAULT 0x00000400
  624. #define PD_SHOWHELP 0x00000800
  625. #define PD_ENABLEPRINTHOOK 0x00001000
  626. #define PD_ENABLESETUPHOOK 0x00002000
  627. #define PD_ENABLEPRINTTEMPLATE 0x00004000
  628. #define PD_ENABLESETUPTEMPLATE 0x00008000
  629. #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
  630. #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
  631. #define PD_USEDEVMODECOPIES 0x00040000
  632. #define PD_USEDEVMODECOPIESANDCOLLATE 0x00040000
  633. #define PD_DISABLEPRINTTOFILE 0x00080000
  634. #define PD_HIDEPRINTTOFILE 0x00100000
  635. #define PD_NONETWORKBUTTON 0x00200000
  636. typedef struct tagDEVNAMES {
  637. WORD wDriverOffset;
  638. WORD wDeviceOffset;
  639. WORD wOutputOffset;
  640. WORD wDefault;
  641. } DEVNAMES;
  642. typedef DEVNAMES * LPDEVNAMES;
  643. #define DN_DEFAULTPRN 0x0001
  644. DWORD APIENTRY CommDlgExtendedError(VOID);
  645. #if(WINVER >= 0x0400)
  646. #define WM_PSD_PAGESETUPDLG (WM_USER )
  647. #define WM_PSD_FULLPAGERECT (WM_USER+1)
  648. #define WM_PSD_MINMARGINRECT (WM_USER+2)
  649. #define WM_PSD_MARGINRECT (WM_USER+3)
  650. #define WM_PSD_GREEKTEXTRECT (WM_USER+4)
  651. #define WM_PSD_ENVSTAMPRECT (WM_USER+5)
  652. #define WM_PSD_YAFULLPAGERECT (WM_USER+6)
  653. typedef UINT (APIENTRY* LPPAGEPAINTHOOK)( HWND, UINT, WPARAM, LPARAM );
  654. typedef UINT (APIENTRY* LPPAGESETUPHOOK)( HWND, UINT, WPARAM, LPARAM );
  655. #ifndef UNICODE_ONLY
  656. typedef struct tagPSDA
  657. {
  658. DWORD lStructSize;
  659. HWND hwndOwner;
  660. HGLOBAL hDevMode;
  661. HGLOBAL hDevNames;
  662. DWORD Flags;
  663. POINT ptPaperSize;
  664. RECT rtMinMargin;
  665. RECT rtMargin;
  666. HINSTANCE hInstance;
  667. LPARAM lCustData;
  668. LPPAGESETUPHOOK lpfnPageSetupHook;
  669. LPPAGEPAINTHOOK lpfnPagePaintHook;
  670. LPCSTR lpPageSetupTemplateName;
  671. HGLOBAL hPageSetupTemplate;
  672. } PAGESETUPDLGA, * LPPAGESETUPDLGA;
  673. #endif //!UNICODE_ONLY
  674. #ifndef ANSI_ONLY
  675. typedef struct tagPSDW
  676. {
  677. DWORD lStructSize;
  678. HWND hwndOwner;
  679. HGLOBAL hDevMode;
  680. HGLOBAL hDevNames;
  681. DWORD Flags;
  682. POINT ptPaperSize;
  683. RECT rtMinMargin;
  684. RECT rtMargin;
  685. HINSTANCE hInstance;
  686. LPARAM lCustData;
  687. LPPAGESETUPHOOK lpfnPageSetupHook;
  688. LPPAGEPAINTHOOK lpfnPagePaintHook;
  689. LPCWSTR lpPageSetupTemplateName;
  690. HGLOBAL hPageSetupTemplate;
  691. } PAGESETUPDLGW, * LPPAGESETUPDLGW;
  692. #endif //!ANSI_ONLY
  693. #ifdef UNICODE
  694. typedef PAGESETUPDLGW PAGESETUPDLG;
  695. typedef LPPAGESETUPDLGW LPPAGESETUPDLG;
  696. #else
  697. typedef PAGESETUPDLGA PAGESETUPDLG;
  698. typedef LPPAGESETUPDLGA LPPAGESETUPDLG;
  699. #endif // UNICODE
  700. #ifndef UNICODE_ONLY
  701. BOOL APIENTRY PageSetupDlgA( LPPAGESETUPDLGA );
  702. #endif //!UNICODE_ONLY
  703. #ifndef ANSI_ONLY
  704. BOOL APIENTRY PageSetupDlgW( LPPAGESETUPDLGW );
  705. #endif //!ANSI_ONLY
  706. #ifdef UNICODE
  707. #define PageSetupDlg PageSetupDlgW
  708. #else
  709. #define PageSetupDlg PageSetupDlgA
  710. #endif // !UNICODE
  711. #define PSD_DEFAULTMINMARGINS 0x00000000 // default (printer's)
  712. #define PSD_INWININIINTLMEASURE 0x00000000 // 1st of 4 possible
  713. #define PSD_MINMARGINS 0x00000001 // use caller's
  714. #define PSD_MARGINS 0x00000002 // use caller's
  715. #define PSD_INTHOUSANDTHSOFINCHES 0x00000004 // 2nd of 4 possible
  716. #define PSD_INHUNDREDTHSOFMILLIMETERS 0x00000008 // 3rd of 4 possible
  717. #define PSD_DISABLEMARGINS 0x00000010
  718. #define PSD_DISABLEPRINTER 0x00000020
  719. #define PSD_NOWARNING 0x00000080 // must be same as PD_*
  720. #define PSD_DISABLEORIENTATION 0x00000100
  721. #define PSD_RETURNDEFAULT 0x00000400 // must be same as PD_*
  722. #define PSD_DISABLEPAPER 0x00000200
  723. #define PSD_SHOWHELP 0x00000800 // must be same as PD_*
  724. #define PSD_ENABLEPAGESETUPHOOK 0x00002000 // must be same as PD_*
  725. #define PSD_ENABLEPAGESETUPTEMPLATE 0x00008000 // must be same as PD_*
  726. #define PSD_ENABLEPAGESETUPTEMPLATEHANDLE 0x00020000 // must be same as PD_*
  727. #define PSD_ENABLEPAGEPAINTHOOK 0x00040000
  728. #define PSD_DISABLEPAGEPAINTING 0x00080000
  729. #endif /* WINVER >= 0x0400 */
  730. #ifdef __cplusplus
  731. }
  732. #endif /* __cplusplus */
  733. #include <poppack.h>
  734. #endif /* !_INC_COMMDLG */