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.

871 lines
30 KiB

  1. /************************************************************************
  2. * *
  3. * commdlg.h -- This module defines the 32-Bit Common Dialog APIs *
  4. * *
  5. * Copyright (c) Microsoft Corporation. All rights reserved. *
  6. * *
  7. ************************************************************************/
  8. #ifndef _INC_COMMDLG
  9. #define _INC_COMMDLG
  10. /*#!perl
  11. MapHeaderToDll("commdlg.h", "comdlg32.dll");
  12. ActivateAroundDelayLoad("comdlg32.dll");
  13. ActivateAroundFunctionCall("comdlg32.dll");
  14. */
  15. ;begin_winver_500
  16. #ifdef DEFINE_GUID
  17. //
  18. // IPrintDialogCallback interface id used by PrintDlgEx.
  19. //
  20. // {5852A2C3-6530-11D1-B6A3-0000F8757BF9}
  21. //
  22. DEFINE_GUID(IID_IPrintDialogCallback, 0x5852a2c3, 0x6530, 0x11d1, 0xb6, 0xa3, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9);
  23. //
  24. // IPrintDialogServices interface id used by PrintDlgEx.
  25. //
  26. // {509AAEDA-5639-11D1-B6A1-0000F8757BF9}
  27. //
  28. DEFINE_GUID(IID_IPrintDialogServices, 0x509aaeda, 0x5639, 0x11d1, 0xb6, 0xa1, 0x0, 0x0, 0xf8, 0x75, 0x7b, 0xf9);
  29. #endif
  30. ;end_winver_500
  31. ;begin_internal
  32. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  33. Copyright (c) Microsoft Corporation. All rights reserved.
  34. Module Name:
  35. commdlgp.h
  36. Abstract:
  37. Private
  38. Procedure declarations, constant definitions and macros for the Common
  39. Dialogs.
  40. --*/
  41. #ifndef _COMMDLGP_
  42. #define _COMMDLGP_
  43. ;end_internal
  44. #ifndef GUID_DEFS_ONLY
  45. #include <prsht.h>
  46. ;begin_both
  47. #if !defined(_WIN64)
  48. #include <pshpack1.h> /* Assume byte packing throughout */
  49. #endif
  50. #ifdef __cplusplus
  51. extern "C" { /* Assume C declarations for C++ */
  52. #endif /* __cplusplus */
  53. ;end_both
  54. //
  55. // Define API decoration for direct importing of DLL references.
  56. //
  57. #ifndef WINCOMMDLGAPI
  58. #if !defined(_COMDLG32_)
  59. #define WINCOMMDLGAPI DECLSPEC_IMPORT
  60. #else
  61. #define WINCOMMDLGAPI
  62. #endif
  63. #endif // WINCOMMDLGAPI
  64. ;begin_winver_400
  65. #ifndef SNDMSG
  66. #ifdef __cplusplus
  67. #ifndef _MAC
  68. #define SNDMSG ::SendMessage
  69. #else
  70. #define SNDMSG ::AfxSendMessage
  71. #endif
  72. #else /* __cplusplus */
  73. #ifndef _MAC
  74. #define SNDMSG SendMessage
  75. #else
  76. #define SNDMSG AfxSendMessage
  77. #endif
  78. #endif /* __cplusplus */
  79. #endif // ifndef SNDMSG
  80. ;end_winver_400
  81. #ifdef _MAC
  82. typedef struct tagEDITMENU
  83. {
  84. HMENU hmenu;
  85. WORD idEdit;
  86. WORD idCut;
  87. WORD idCopy;
  88. WORD idPaste;
  89. WORD idClear;
  90. WORD idUndo;
  91. } EDITMENU;
  92. typedef EDITMENU *LPEDITMENU;
  93. #endif
  94. typedef UINT_PTR (CALLBACK *LPOFNHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  95. #ifndef CDSIZEOF_STRUCT
  96. #define CDSIZEOF_STRUCT(structname, member) (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))
  97. #endif
  98. //
  99. // For compilers that don't support nameless unions
  100. //
  101. #ifndef DUMMYUNIONNAME
  102. #ifdef NONAMELESSUNION
  103. #define DUMMYUNIONNAME u
  104. #endif // NONAMELESSUNION
  105. #endif // DUMMYUNIONNAME
  106. typedef struct tagOFN_NT4% {
  107. DWORD lStructSize;
  108. HWND hwndOwner;
  109. HINSTANCE hInstance;
  110. LPCTSTR% lpstrFilter;
  111. LPTSTR% lpstrCustomFilter;
  112. DWORD nMaxCustFilter;
  113. DWORD nFilterIndex;
  114. LPTSTR% lpstrFile;
  115. DWORD nMaxFile;
  116. LPTSTR% lpstrFileTitle;
  117. DWORD nMaxFileTitle;
  118. LPCTSTR% lpstrInitialDir;
  119. LPCTSTR% lpstrTitle;
  120. DWORD Flags;
  121. WORD nFileOffset;
  122. WORD nFileExtension;
  123. LPCTSTR% lpstrDefExt;
  124. LPARAM lCustData;
  125. LPOFNHOOKPROC lpfnHook;
  126. LPCTSTR% lpTemplateName;
  127. } OPENFILENAME_NT4%, *LPOPENFILENAME_NT4%;
  128. typedef struct tagOFN% {
  129. DWORD lStructSize;
  130. HWND hwndOwner;
  131. HINSTANCE hInstance;
  132. LPCTSTR% lpstrFilter;
  133. LPTSTR% lpstrCustomFilter;
  134. DWORD nMaxCustFilter;
  135. DWORD nFilterIndex;
  136. LPTSTR% lpstrFile;
  137. DWORD nMaxFile;
  138. LPTSTR% lpstrFileTitle;
  139. DWORD nMaxFileTitle;
  140. LPCTSTR% lpstrInitialDir;
  141. LPCTSTR% lpstrTitle;
  142. DWORD Flags;
  143. WORD nFileOffset;
  144. WORD nFileExtension;
  145. LPCTSTR% lpstrDefExt;
  146. LPARAM lCustData;
  147. LPOFNHOOKPROC lpfnHook;
  148. LPCTSTR% lpTemplateName;
  149. #ifdef _MAC
  150. LPEDITMENU lpEditInfo;
  151. LPCSTR lpstrPrompt;
  152. #endif
  153. #if (_WIN32_WINNT >= 0x0500)
  154. void * pvReserved;
  155. DWORD dwReserved;
  156. DWORD FlagsEx;
  157. #endif // (_WIN32_WINNT >= 0x0500)
  158. } OPENFILENAME%, *LPOPENFILENAME%;
  159. #if (_WIN32_WINNT >= 0x0500)
  160. #define OPENFILENAME_SIZE_VERSION_400% CDSIZEOF_STRUCT(OPENFILENAME%,lpTemplateName)
  161. #endif // (_WIN32_WINNT >= 0x0500)
  162. WINCOMMDLGAPI BOOL APIENTRY GetOpenFileName%(LPOPENFILENAME%);
  163. WINCOMMDLGAPI BOOL APIENTRY GetSaveFileName%(LPOPENFILENAME%);
  164. /* #!perl DeclareFunctionErrorValue("GetFileTitleA", "-1"); */
  165. /* #!perl DeclareFunctionErrorValue("GetFileTitleW", "-1"); */
  166. WINCOMMDLGAPI short APIENTRY GetFileTitle%(LPCTSTR%, LPTSTR%, WORD);
  167. #define OFN_READONLY 0x00000001
  168. #define OFN_OVERWRITEPROMPT 0x00000002
  169. #define OFN_HIDEREADONLY 0x00000004
  170. #define OFN_NOCHANGEDIR 0x00000008
  171. #define OFN_SHOWHELP 0x00000010
  172. #define OFN_ENABLEHOOK 0x00000020
  173. #define OFN_ENABLETEMPLATE 0x00000040
  174. #define OFN_ENABLETEMPLATEHANDLE 0x00000080
  175. #define OFN_NOVALIDATE 0x00000100
  176. #define OFN_ALLOWMULTISELECT 0x00000200
  177. #define OFN_EXTENSIONDIFFERENT 0x00000400
  178. #define OFN_PATHMUSTEXIST 0x00000800
  179. #define OFN_FILEMUSTEXIST 0x00001000
  180. #define OFN_CREATEPROMPT 0x00002000
  181. #define OFN_SHAREAWARE 0x00004000
  182. #define OFN_NOREADONLYRETURN 0x00008000
  183. #define OFN_NOTESTFILECREATE 0x00010000
  184. #define OFN_NONETWORKBUTTON 0x00020000
  185. #define OFN_NOLONGNAMES 0x00040000 // force no long names for 4.x modules
  186. ;begin_winver_400
  187. #define OFN_EXPLORER 0x00080000 // new look commdlg
  188. #define OFN_NODEREFERENCELINKS 0x00100000
  189. #define OFN_LONGNAMES 0x00200000 // force long names for 3.x modules
  190. #define OFN_ENABLEINCLUDENOTIFY 0x00400000 // send include message to callback
  191. #define OFN_ENABLESIZING 0x00800000
  192. ;end_winver_400
  193. #if (_WIN32_WINNT >= 0x0500)
  194. #define OFN_DONTADDTORECENT 0x02000000
  195. // reserved for CD_WX86APP 0x04000000 ;internal
  196. // reserved for CD_WOWAPP 0x08000000 ;internal
  197. #define OFN_FORCESHOWHIDDEN 0x10000000 // Show All files including System and hidden files
  198. #endif // (_WIN32_WINNT >= 0x0500)
  199. // reserved 0xx0000000 ;internal
  200. //FlagsEx Values
  201. #if (_WIN32_WINNT >= 0x0500)
  202. #define OFN_EX_NOPLACESBAR 0x00000001
  203. #endif // (_WIN32_WINNT >= 0x0500)
  204. // Return values for the registered message sent to the hook function
  205. // when a sharing violation occurs. OFN_SHAREFALLTHROUGH allows the
  206. // filename to be accepted, OFN_SHARENOWARN rejects the name but puts
  207. // up no warning (returned when the app has already put up a warning
  208. // message), and OFN_SHAREWARN puts up the default warning message
  209. // for sharing violations.
  210. //
  211. // Note: Undefined return values map to OFN_SHAREWARN, but are
  212. // reserved for future use.
  213. #define OFN_SHAREFALLTHROUGH 2
  214. #define OFN_SHARENOWARN 1
  215. #define OFN_SHAREWARN 0
  216. typedef UINT_PTR (CALLBACK *LPCCHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  217. ;begin_winver_400
  218. // Structure used for all file based OpenFileName notifications
  219. typedef struct _OFNOTIFY%
  220. {
  221. NMHDR hdr;
  222. LPOPENFILENAME% lpOFN;
  223. LPTSTR% pszFile; // May be NULL
  224. } OFNOTIFY%, *LPOFNOTIFY%;
  225. // Structure used for all object based OpenFileName notifications
  226. typedef struct _OFNOTIFYEX%
  227. {
  228. NMHDR hdr;
  229. LPOPENFILENAME% lpOFN;
  230. LPVOID psf;
  231. LPVOID pidl; // May be NULL
  232. } OFNOTIFYEX%, *LPOFNOTIFYEX%;
  233. #define CDN_FIRST (0U-601U)
  234. #define CDN_LAST (0U-699U)
  235. // Notifications from Open or Save dialog
  236. #define CDN_INITDONE (CDN_FIRST - 0x0000)
  237. #define CDN_SELCHANGE (CDN_FIRST - 0x0001)
  238. #define CDN_FOLDERCHANGE (CDN_FIRST - 0x0002)
  239. #define CDN_SHAREVIOLATION (CDN_FIRST - 0x0003)
  240. #define CDN_HELP (CDN_FIRST - 0x0004)
  241. #define CDN_FILEOK (CDN_FIRST - 0x0005)
  242. #define CDN_TYPECHANGE (CDN_FIRST - 0x0006)
  243. #define CDN_INCLUDEITEM (CDN_FIRST - 0x0007)
  244. #define CDM_FIRST (WM_USER + 100)
  245. #define CDM_LAST (WM_USER + 200)
  246. // Messages to query information from the Open or Save dialogs
  247. // lParam = pointer to text buffer that gets filled in
  248. // wParam = max number of characters of the text buffer (including NULL)
  249. // return = < 0 if error; number of characters needed (including NULL)
  250. #define CDM_GETSPEC (CDM_FIRST + 0x0000)
  251. #define CommDlg_OpenSave_GetSpec%(_hdlg, _psz, _cbmax) \
  252. (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPTSTR%)_psz)
  253. // lParam = pointer to text buffer that gets filled in
  254. // wParam = max number of characters of the text buffer (including NULL)
  255. // return = < 0 if error; number of characters needed (including NULL)
  256. #define CDM_GETFILEPATH (CDM_FIRST + 0x0001)
  257. #define CommDlg_OpenSave_GetFilePath%(_hdlg, _psz, _cbmax) \
  258. (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPTSTR%)_psz)
  259. // lParam = pointer to text buffer that gets filled in
  260. // wParam = max number of characters of the text buffer (including NULL)
  261. // return = < 0 if error; number of characters needed (including NULL)
  262. #define CDM_GETFOLDERPATH (CDM_FIRST + 0x0002)
  263. #define CommDlg_OpenSave_GetFolderPath%(_hdlg, _psz, _cbmax) \
  264. (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPTSTR%)_psz)
  265. // lParam = pointer to ITEMIDLIST buffer that gets filled in
  266. // wParam = size of the ITEMIDLIST buffer
  267. // return = < 0 if error; length of buffer needed
  268. #define CDM_GETFOLDERIDLIST (CDM_FIRST + 0x0003)
  269. #define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) \
  270. (int)SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl)
  271. // lParam = pointer to a string
  272. // wParam = ID of control to change
  273. // return = not used
  274. #define CDM_SETCONTROLTEXT (CDM_FIRST + 0x0004)
  275. #define CommDlg_OpenSave_SetControlText(_hdlg, _id, _text) \
  276. (void)SNDMSG(_hdlg, CDM_SETCONTROLTEXT, (WPARAM)_id, (LPARAM)(LPSTR)_text)
  277. // lParam = not used
  278. // wParam = ID of control to change
  279. // return = not used
  280. #define CDM_HIDECONTROL (CDM_FIRST + 0x0005)
  281. #define CommDlg_OpenSave_HideControl(_hdlg, _id) \
  282. (void)SNDMSG(_hdlg, CDM_HIDECONTROL, (WPARAM)_id, 0)
  283. // lParam = pointer to default extension (no dot)
  284. // wParam = not used
  285. // return = not used
  286. #define CDM_SETDEFEXT (CDM_FIRST + 0x0006)
  287. #define CommDlg_OpenSave_SetDefExt(_hdlg, _pszext) \
  288. (void)SNDMSG(_hdlg, CDM_SETDEFEXT, 0, (LPARAM)(LPSTR)_pszext)
  289. ;end_winver_400
  290. #ifndef _MAC
  291. typedef struct tagCHOOSECOLOR% {
  292. DWORD lStructSize;
  293. HWND hwndOwner;
  294. HWND hInstance;
  295. COLORREF rgbResult;
  296. COLORREF* lpCustColors;
  297. DWORD Flags;
  298. LPARAM lCustData;
  299. LPCCHOOKPROC lpfnHook;
  300. LPCTSTR% lpTemplateName;
  301. } CHOOSECOLOR%, *LPCHOOSECOLOR%;
  302. #else
  303. typedef struct tagCHOOSECOLOR% {
  304. DWORD lStructSize;
  305. HWND hwndOwner;
  306. HWND hInstance;
  307. COLORREF rgbResult;
  308. COLORREF* lpCustColors;
  309. DWORD Flags;
  310. LPARAM lCustData;
  311. LPCCHOOKPROC lpfnHook;
  312. LPCTSTR% lpTemplateName;
  313. LPEDITMENU lpEditInfo;
  314. } CHOOSECOLOR%, *LPCHOOSECOLOR%;
  315. #endif //_MAC
  316. WINCOMMDLGAPI BOOL APIENTRY ChooseColor%(LPCHOOSECOLOR%);
  317. #define CC_RGBINIT 0x00000001
  318. #define CC_FULLOPEN 0x00000002
  319. #define CC_PREVENTFULLOPEN 0x00000004
  320. #define CC_SHOWHELP 0x00000008
  321. #define CC_ENABLEHOOK 0x00000010
  322. #define CC_ENABLETEMPLATE 0x00000020
  323. #define CC_ENABLETEMPLATEHANDLE 0x00000040
  324. ;begin_winver_400
  325. #define CC_SOLIDCOLOR 0x00000080
  326. #define CC_ANYCOLOR 0x00000100
  327. ;end_winver_400
  328. // reserved 0x?0000000 ;internal
  329. typedef UINT_PTR (CALLBACK *LPFRHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  330. typedef struct tagFINDREPLACE% {
  331. DWORD lStructSize; // size of this struct 0x20
  332. HWND hwndOwner; // handle to owner's window
  333. HINSTANCE hInstance; // instance handle of.EXE that
  334. // contains cust. dlg. template
  335. DWORD Flags; // one or more of the FR_??
  336. LPTSTR% lpstrFindWhat; // ptr. to search string
  337. LPTSTR% lpstrReplaceWith; // ptr. to replace string
  338. WORD wFindWhatLen; // size of find buffer
  339. WORD wReplaceWithLen; // size of replace buffer
  340. LPARAM lCustData; // data passed to hook fn.
  341. LPFRHOOKPROC lpfnHook; // ptr. to hook fn. or NULL
  342. LPCTSTR% lpTemplateName; // custom template name
  343. } FINDREPLACE%, *LPFINDREPLACE%;
  344. #define FR_DOWN 0x00000001
  345. #define FR_WHOLEWORD 0x00000002
  346. #define FR_MATCHCASE 0x00000004
  347. #define FR_FINDNEXT 0x00000008
  348. #define FR_REPLACE 0x00000010
  349. #define FR_REPLACEALL 0x00000020
  350. #define FR_DIALOGTERM 0x00000040
  351. #define FR_SHOWHELP 0x00000080
  352. #define FR_ENABLEHOOK 0x00000100
  353. #define FR_ENABLETEMPLATE 0x00000200
  354. #define FR_NOUPDOWN 0x00000400
  355. #define FR_NOMATCHCASE 0x00000800
  356. #define FR_NOWHOLEWORD 0x00001000
  357. #define FR_ENABLETEMPLATEHANDLE 0x00002000
  358. #define FR_HIDEUPDOWN 0x00004000
  359. #define FR_HIDEMATCHCASE 0x00008000
  360. #define FR_HIDEWHOLEWORD 0x00010000
  361. #define FR_RAW 0x00020000
  362. #define FR_MATCHDIAC 0x20000000
  363. #define FR_MATCHKASHIDA 0x40000000
  364. #define FR_MATCHALEFHAMZA 0x80000000
  365. // 0x?0000000 is reserved for internal use ;internal
  366. WINCOMMDLGAPI HWND APIENTRY FindText%(LPFINDREPLACE%);
  367. #ifndef _MAC
  368. WINCOMMDLGAPI HWND APIENTRY ReplaceText%(LPFINDREPLACE%);
  369. #else
  370. WINCOMMDLGAPI HWND APIENTRY AfxReplaceText%(LPFINDREPLACE%);
  371. #endif
  372. typedef UINT_PTR (CALLBACK *LPCFHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  373. typedef struct tagCHOOSEFONT% {
  374. DWORD lStructSize;
  375. HWND hwndOwner; // caller's window handle
  376. HDC hDC; // printer DC/IC or NULL
  377. LPLOGFONT% lpLogFont; // ptr. to a LOGFONT struct
  378. INT iPointSize; // 10 * size in points of selected font
  379. DWORD Flags; // enum. type flags
  380. COLORREF rgbColors; // returned text color
  381. LPARAM lCustData; // data passed to hook fn.
  382. LPCFHOOKPROC lpfnHook; // ptr. to hook function
  383. LPCTSTR% lpTemplateName; // custom template name
  384. HINSTANCE hInstance; // instance handle of.EXE that
  385. // contains cust. dlg. template
  386. LPTSTR% lpszStyle; // return the style field here
  387. // must be LF_FACESIZE or bigger
  388. WORD nFontType; // same value reported to the EnumFonts
  389. // call back with the extra FONTTYPE_
  390. // bits added
  391. WORD ___MISSING_ALIGNMENT__;
  392. INT nSizeMin; // minimum pt size allowed &
  393. INT nSizeMax; // max pt size allowed if
  394. // CF_LIMITSIZE is used
  395. } CHOOSEFONT%, *LPCHOOSEFONT%;
  396. WINCOMMDLGAPI BOOL APIENTRY ChooseFont%(LPCHOOSEFONT%);
  397. #define CF_SCREENFONTS 0x00000001
  398. #define CF_PRINTERFONTS 0x00000002
  399. #define CF_BOTH (CF_SCREENFONTS | CF_PRINTERFONTS)
  400. #define CF_SHOWHELP 0x00000004L
  401. #define CF_ENABLEHOOK 0x00000008L
  402. #define CF_ENABLETEMPLATE 0x00000010L
  403. #define CF_ENABLETEMPLATEHANDLE 0x00000020L
  404. #define CF_INITTOLOGFONTSTRUCT 0x00000040L
  405. #define CF_USESTYLE 0x00000080L
  406. #define CF_EFFECTS 0x00000100L
  407. #define CF_APPLY 0x00000200L
  408. #define CF_ANSIONLY 0x00000400L
  409. ;begin_winver_400
  410. #define CF_SCRIPTSONLY CF_ANSIONLY
  411. ;end_winver_400
  412. #define CF_NOVECTORFONTS 0x00000800L
  413. #define CF_NOOEMFONTS CF_NOVECTORFONTS
  414. #define CF_NOSIMULATIONS 0x00001000L
  415. #define CF_LIMITSIZE 0x00002000L
  416. #define CF_FIXEDPITCHONLY 0x00004000L
  417. #define CF_WYSIWYG 0x00008000L // must also have CF_SCREENFONTS & CF_PRINTERFONTS
  418. #define CF_FORCEFONTEXIST 0x00010000L
  419. #define CF_SCALABLEONLY 0x00020000L
  420. #define CF_TTONLY 0x00040000L
  421. #define CF_NOFACESEL 0x00080000L
  422. #define CF_NOSTYLESEL 0x00100000L
  423. #define CF_NOSIZESEL 0x00200000L
  424. ;begin_winver_400
  425. #define CF_SELECTSCRIPT 0x00400000L
  426. #define CF_NOSCRIPTSEL 0x00800000L
  427. #define CF_NOVERTFONTS 0x01000000L
  428. ;end_winver_400
  429. // reserved for internal use 0x?0000000L ;internal
  430. // these are extra nFontType bits that are added to what is returned to the
  431. // EnumFonts callback routine
  432. #define SIMULATED_FONTTYPE 0x8000
  433. #define PRINTER_FONTTYPE 0x4000
  434. #define SCREEN_FONTTYPE 0x2000
  435. #define BOLD_FONTTYPE 0x0100
  436. #define ITALIC_FONTTYPE 0x0200
  437. #define REGULAR_FONTTYPE 0x0400
  438. // EnumFonts callback routine only uses these bits, so we can use the rest
  439. // #define RASTER_FONTTYPE 0x001
  440. // #define DEVICE_FONTTYPE 0x002
  441. // #define TRUETYPE_FONTTYPE 0x004
  442. #ifdef WINNT
  443. #define PS_OPENTYPE_FONTTYPE 0x10000
  444. #define TT_OPENTYPE_FONTTYPE 0x20000
  445. #define TYPE1_FONTTYPE 0x40000
  446. #endif
  447. #define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
  448. #define WM_CHOOSEFONT_SETLOGFONT (WM_USER + 101) ;public_win40
  449. #define WM_CHOOSEFONT_SETFLAGS (WM_USER + 102) ;public_win40
  450. // strings used to obtain unique window message for communication
  451. // between dialog and caller
  452. #define LBSELCHSTRINGA "commdlg_LBSelChangedNotify"
  453. #define SHAREVISTRINGA "commdlg_ShareViolation"
  454. #define FILEOKSTRINGA "commdlg_FileNameOK"
  455. #define COLOROKSTRINGA "commdlg_ColorOK"
  456. #define SETRGBSTRINGA "commdlg_SetRGBColor"
  457. #define HELPMSGSTRINGA "commdlg_help"
  458. #define FINDMSGSTRINGA "commdlg_FindReplace"
  459. #define LBSELCHSTRINGW L"commdlg_LBSelChangedNotify"
  460. #define SHAREVISTRINGW L"commdlg_ShareViolation"
  461. #define FILEOKSTRINGW L"commdlg_FileNameOK"
  462. #define COLOROKSTRINGW L"commdlg_ColorOK"
  463. #define SETRGBSTRINGW L"commdlg_SetRGBColor"
  464. #define HELPMSGSTRINGW L"commdlg_help"
  465. #define FINDMSGSTRINGW L"commdlg_FindReplace"
  466. #ifdef UNICODE
  467. #define LBSELCHSTRING LBSELCHSTRINGW
  468. #define SHAREVISTRING SHAREVISTRINGW
  469. #define FILEOKSTRING FILEOKSTRINGW
  470. #define COLOROKSTRING COLOROKSTRINGW
  471. #define SETRGBSTRING SETRGBSTRINGW
  472. #define HELPMSGSTRING HELPMSGSTRINGW
  473. #define FINDMSGSTRING FINDMSGSTRINGW
  474. #else
  475. #define LBSELCHSTRING LBSELCHSTRINGA
  476. #define SHAREVISTRING SHAREVISTRINGA
  477. #define FILEOKSTRING FILEOKSTRINGA
  478. #define COLOROKSTRING COLOROKSTRINGA
  479. #define SETRGBSTRING SETRGBSTRINGA
  480. #define HELPMSGSTRING HELPMSGSTRINGA
  481. #define FINDMSGSTRING FINDMSGSTRINGA
  482. #endif
  483. // HIWORD values for lParam of commdlg_LBSelChangeNotify message
  484. #define CD_LBSELNOITEMS -1
  485. #define CD_LBSELCHANGE 0
  486. #define CD_LBSELSUB 1
  487. #define CD_LBSELADD 2
  488. typedef UINT_PTR (CALLBACK *LPPRINTHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  489. typedef UINT_PTR (CALLBACK *LPSETUPHOOKPROC) (HWND, UINT, WPARAM, LPARAM);
  490. typedef struct tagPD% {
  491. DWORD lStructSize;
  492. HWND hwndOwner;
  493. HGLOBAL hDevMode;
  494. HGLOBAL hDevNames;
  495. HDC hDC;
  496. DWORD Flags;
  497. WORD nFromPage;
  498. WORD nToPage;
  499. WORD nMinPage;
  500. WORD nMaxPage;
  501. WORD nCopies;
  502. HINSTANCE hInstance;
  503. LPARAM lCustData;
  504. LPPRINTHOOKPROC lpfnPrintHook;
  505. LPSETUPHOOKPROC lpfnSetupHook;
  506. LPCTSTR% lpPrintTemplateName;
  507. LPCTSTR% lpSetupTemplateName;
  508. HGLOBAL hPrintTemplate;
  509. HGLOBAL hSetupTemplate;
  510. } PRINTDLG%, *LPPRINTDLG%;
  511. WINCOMMDLGAPI BOOL APIENTRY PrintDlg%(LPPRINTDLG%);
  512. ;begin_winver_500
  513. #ifdef STDMETHOD
  514. //-------------------------------------------------------------------------
  515. //
  516. // IPrintDialogCallback Interface
  517. //
  518. // IPrintDialogCallback::InitDone()
  519. // This function is called by PrintDlgEx when the system has finished
  520. // initializing the main page of the print dialog. This function
  521. // should return S_OK if it has processed the action or S_FALSE to let
  522. // PrintDlgEx perform the default action.
  523. //
  524. // IPrintDialogCallback::SelectionChange()
  525. // This function is called by PrintDlgEx when a selection change occurs
  526. // in the list view that displays the currently installed printers.
  527. // This function should return S_OK if it has processed the action or
  528. // S_FALSE to let PrintDlgEx perform the default action.
  529. //
  530. // IPrintDialogCallback::HandleMessage(hDlg, uMsg, wParam, lParam, pResult)
  531. // This function is called by PrintDlgEx when a message is sent to the
  532. // child window of the main page of the print dialog. This function
  533. // should return S_OK if it has processed the action or S_FALSE to let
  534. // PrintDlgEx perform the default action.
  535. //
  536. // IObjectWithSite::SetSite(punkSite)
  537. // IPrintDialogCallback usually paired with IObjectWithSite.
  538. // Provides the IUnknown pointer of the site to QI for the
  539. // IPrintDialogServices interface.
  540. //
  541. //-------------------------------------------------------------------------
  542. #undef INTERFACE
  543. #define INTERFACE IPrintDialogCallback
  544. DECLARE_INTERFACE_(IPrintDialogCallback, IUnknown)
  545. {
  546. // *** IUnknown methods ***
  547. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  548. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  549. STDMETHOD_(ULONG, Release) (THIS) PURE;
  550. // *** IPrintDialogCallback methods ***
  551. STDMETHOD(InitDone) (THIS) PURE;
  552. STDMETHOD(SelectionChange) (THIS) PURE;
  553. STDMETHOD(HandleMessage) (THIS_ HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult) PURE;
  554. };
  555. //-------------------------------------------------------------------------
  556. //
  557. // IPrintDialogServices Interface
  558. //
  559. // IPrintDialogServices::GetCurrentDevMode(pDevMode, pcbSize)
  560. // Returns the DEVMODE structure for the currently selected printer.
  561. //
  562. // IPrintDialogServices::GetCurrentPrinterName(pPrinterName, pcchSize)
  563. // Returns the printer name for the currently selected printer.
  564. //
  565. // IPrintDialogServices::GetCurrentPortName(pPortName, pcchSize)
  566. // Returns the port name for the currently selected printer.
  567. //
  568. //-------------------------------------------------------------------------
  569. #undef INTERFACE
  570. #define INTERFACE IPrintDialogServices
  571. DECLARE_INTERFACE_(IPrintDialogServices, IUnknown)
  572. {
  573. // *** IUnknown methods ***
  574. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  575. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  576. STDMETHOD_(ULONG, Release) (THIS) PURE;
  577. // *** IPrintDialogServices methods ***
  578. STDMETHOD(GetCurrentDevMode) (THIS_ LPDEVMODE pDevMode, UINT *pcbSize) PURE;
  579. STDMETHOD(GetCurrentPrinterName) (THIS_ LPTSTR pPrinterName, UINT *pcchSize) PURE;
  580. STDMETHOD(GetCurrentPortName) (THIS_ LPTSTR pPortName, UINT *pcchSize) PURE;
  581. };
  582. //
  583. // Page Range structure for PrintDlgEx.
  584. //
  585. typedef struct tagPRINTPAGERANGE {
  586. DWORD nFromPage;
  587. DWORD nToPage;
  588. } PRINTPAGERANGE, *LPPRINTPAGERANGE;
  589. //
  590. // PrintDlgEx structure.
  591. //
  592. typedef struct tagPDEX% {
  593. DWORD lStructSize; // size of structure in bytes
  594. HWND hwndOwner; // caller's window handle
  595. HGLOBAL hDevMode; // handle to DevMode
  596. HGLOBAL hDevNames; // handle to DevNames
  597. HDC hDC; // printer DC/IC or NULL
  598. DWORD Flags; // PD_ flags
  599. DWORD Flags2; // reserved
  600. DWORD ExclusionFlags; // items to exclude from driver pages
  601. DWORD nPageRanges; // number of page ranges
  602. DWORD nMaxPageRanges; // max number of page ranges
  603. LPPRINTPAGERANGE lpPageRanges; // array of page ranges
  604. DWORD nMinPage; // min page number
  605. DWORD nMaxPage; // max page number
  606. DWORD nCopies; // number of copies
  607. HINSTANCE hInstance; // instance handle
  608. LPCTSTR% lpPrintTemplateName; // template name for app specific area
  609. LPUNKNOWN lpCallback; // app callback interface
  610. DWORD nPropertyPages; // number of app property pages in lphPropertyPages
  611. HPROPSHEETPAGE *lphPropertyPages; // array of app property page handles
  612. DWORD nStartPage; // start page id
  613. DWORD dwResultAction; // result action if S_OK is returned
  614. } PRINTDLGEX%, *LPPRINTDLGEX%;
  615. /* #!perl PoundIf("PrintDlgExA", "defined(STDMETHOD) && (WINVER >= 0x0500)"); */
  616. /* #!perl PoundIf("PrintDlgExW", "defined(STDMETHOD) && (WINVER >= 0x0500)"); */
  617. WINCOMMDLGAPI HRESULT APIENTRY PrintDlgEx%(LPPRINTDLGEX%);
  618. #endif
  619. ;end_winver_500
  620. //
  621. // Flags for PrintDlg and PrintDlgEx.
  622. //
  623. #define PD_ALLPAGES 0x00000000
  624. #define PD_SELECTION 0x00000001
  625. #define PD_PAGENUMS 0x00000002
  626. #define PD_NOSELECTION 0x00000004
  627. #define PD_NOPAGENUMS 0x00000008
  628. #define PD_COLLATE 0x00000010
  629. #define PD_PRINTTOFILE 0x00000020
  630. #define PD_PRINTSETUP 0x00000040
  631. #define PD_NOWARNING 0x00000080
  632. #define PD_RETURNDC 0x00000100
  633. #define PD_RETURNIC 0x00000200
  634. #define PD_RETURNDEFAULT 0x00000400
  635. #define PD_SHOWHELP 0x00000800
  636. #define PD_ENABLEPRINTHOOK 0x00001000
  637. #define PD_ENABLESETUPHOOK 0x00002000
  638. #define PD_ENABLEPRINTTEMPLATE 0x00004000
  639. #define PD_ENABLESETUPTEMPLATE 0x00008000
  640. #define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
  641. #define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
  642. #define PD_USEDEVMODECOPIES 0x00040000
  643. #define PD_USEDEVMODECOPIESANDCOLLATE 0x00040000
  644. #define PD_DISABLEPRINTTOFILE 0x00080000
  645. #define PD_HIDEPRINTTOFILE 0x00100000
  646. #define PD_NONETWORKBUTTON 0x00200000
  647. ;begin_winver_500
  648. #define PD_CURRENTPAGE 0x00400000
  649. #define PD_NOCURRENTPAGE 0x00800000
  650. #define PD_EXCLUSIONFLAGS 0x01000000
  651. // reserved for CD_WX86APP 0x04000000 ;internal
  652. // reserved for CD_WOWAPP 0x08000000 ;internal
  653. #define PD_USELARGETEMPLATE 0x10000000
  654. ;end_winver_500
  655. #define PD_PAGESETUP 0x40000000 ;internal
  656. //// reserved 0x?0000000 ;internal
  657. ;begin_winver_500
  658. //
  659. // Exclusion flags for PrintDlgEx.
  660. //
  661. #define PD_EXCL_COPIESANDCOLLATE (DM_COPIES | DM_COLLATE)
  662. //
  663. // Define the start page for the print dialog when using PrintDlgEx.
  664. //
  665. #define START_PAGE_GENERAL 0xffffffff
  666. //
  667. // Result action ids for PrintDlgEx.
  668. //
  669. #define PD_RESULT_CANCEL 0
  670. #define PD_RESULT_PRINT 1
  671. #define PD_RESULT_APPLY 2
  672. ;end_winver_500
  673. //
  674. // Device Names structure for PrintDlg and PrintDlgEx.
  675. //
  676. typedef struct tagDEVNAMES {
  677. WORD wDriverOffset;
  678. WORD wDeviceOffset;
  679. WORD wOutputOffset;
  680. WORD wDefault;
  681. } DEVNAMES, *LPDEVNAMES;
  682. #define DN_DEFAULTPRN 0x0001
  683. /* #!perl
  684. // 0 is based on the comdlg32 dload stub.
  685. DeclareFunctionErrorValue("CommDlgExtendedError", "0");
  686. */
  687. WINCOMMDLGAPI DWORD APIENTRY CommDlgExtendedError(VOID);
  688. ;begin_winver_400
  689. #define WM_PSD_PAGESETUPDLG (WM_USER )
  690. #define WM_PSD_FULLPAGERECT (WM_USER+1)
  691. #define WM_PSD_MINMARGINRECT (WM_USER+2)
  692. #define WM_PSD_MARGINRECT (WM_USER+3)
  693. #define WM_PSD_GREEKTEXTRECT (WM_USER+4)
  694. #define WM_PSD_ENVSTAMPRECT (WM_USER+5)
  695. #define WM_PSD_YAFULLPAGERECT (WM_USER+6)
  696. typedef UINT_PTR (CALLBACK* LPPAGEPAINTHOOK)( HWND, UINT, WPARAM, LPARAM );
  697. typedef UINT_PTR (CALLBACK* LPPAGESETUPHOOK)( HWND, UINT, WPARAM, LPARAM );
  698. typedef struct tagPSD%
  699. {
  700. DWORD lStructSize;
  701. HWND hwndOwner;
  702. HGLOBAL hDevMode;
  703. HGLOBAL hDevNames;
  704. DWORD Flags;
  705. POINT ptPaperSize;
  706. RECT rtMinMargin;
  707. RECT rtMargin;
  708. HINSTANCE hInstance;
  709. LPARAM lCustData;
  710. LPPAGESETUPHOOK lpfnPageSetupHook;
  711. LPPAGEPAINTHOOK lpfnPagePaintHook;
  712. LPCTSTR% lpPageSetupTemplateName;
  713. HGLOBAL hPageSetupTemplate;
  714. } PAGESETUPDLG%, * LPPAGESETUPDLG%;
  715. WINCOMMDLGAPI BOOL APIENTRY PageSetupDlg%( LPPAGESETUPDLG% );
  716. #define PSD_DEFAULTMINMARGINS 0x00000000 // default (printer's)
  717. #define PSD_INWININIINTLMEASURE 0x00000000 // 1st of 4 possible
  718. #define PSD_MINMARGINS 0x00000001 // use caller's
  719. #define PSD_MARGINS 0x00000002 // use caller's
  720. #define PSD_INTHOUSANDTHSOFINCHES 0x00000004 // 2nd of 4 possible
  721. #define PSD_INHUNDREDTHSOFMILLIMETERS 0x00000008 // 3rd of 4 possible
  722. #define PSD_DISABLEMARGINS 0x00000010
  723. #define PSD_DISABLEPRINTER 0x00000020
  724. #define PSD_NOWARNING 0x00000080 // must be same as PD_*
  725. #define PSD_DISABLEORIENTATION 0x00000100
  726. #define PSD_RETURNDEFAULT 0x00000400 // must be same as PD_*
  727. #define PSD_DISABLEPAPER 0x00000200
  728. #define PSD_SHOWHELP 0x00000800 // must be same as PD_*
  729. #define PSD_ENABLEPAGESETUPHOOK 0x00002000 // must be same as PD_*
  730. #define PSD_ENABLEPAGESETUPTEMPLATE 0x00008000 // must be same as PD_*
  731. #define PSD_ENABLEPAGESETUPTEMPLATEHANDLE 0x00020000 // must be same as PD_*
  732. #define PSD_ENABLEPAGEPAINTHOOK 0x00040000
  733. #define PSD_DISABLEPAGEPAINTING 0x00080000
  734. #define PSD_NONETWORKBUTTON 0x00200000 // must be same as PD_*
  735. ;end_winver_400
  736. ;begin_both
  737. #ifdef __cplusplus
  738. }
  739. #endif /* __cplusplus */
  740. #if !defined(_WIN64)
  741. #include <poppack.h>
  742. #endif
  743. ;end_both
  744. #endif /* GUID_DEFS_ONLY */
  745. #endif /* _COMMDLGP_ */ ;internal
  746. #endif /* !_INC_COMMDLG */