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.

162 lines
6.2 KiB

  1. #ifndef _AFXPRNTX_H_
  2. #define _AFXPRNTX_H_
  3. #ifdef _DEBUG
  4. # ifdef _UNICODE
  5. # ifdef _AFXDLL
  6. # pragma comment(lib, "MFCPrintDialogExDUD.lib")
  7. # else
  8. # pragma comment(lib, "MFCPrintDialogExSUD.lib")
  9. # endif
  10. # else
  11. # ifdef _AFXDLL
  12. # pragma comment(lib, "MFCPrintDialogExDAD.lib")
  13. # else
  14. # pragma comment(lib, "MFCPrintDialogExSAD.lib")
  15. # endif
  16. # endif
  17. #else
  18. # ifdef _UNICODE
  19. # ifdef _AFXDLL
  20. # pragma comment(lib, "MFCPrintDialogExDU.lib")
  21. # else
  22. # pragma comment(lib, "MFCPrintDialogExSU.lib")
  23. # endif
  24. # else
  25. # ifdef _AFXDLL
  26. # pragma comment(lib, "MFCPrintDialogExDA.lib")
  27. # else
  28. # pragma comment(lib, "MFCPrintDialogExSA.lib")
  29. # endif
  30. # endif
  31. #endif
  32. //WINBUG: these declarations are not yet in the NT5 Headers
  33. #ifndef PD_RESULT_CANCEL
  34. #undef INTERFACE
  35. #define INTERFACE IPrintDialogCallback
  36. DECLARE_INTERFACE_(IPrintDialogCallback, IUnknown)
  37. {
  38. // *** IUnknown methods ***
  39. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE;
  40. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  41. STDMETHOD_(ULONG, Release) (THIS) PURE;
  42. // *** IPrintDialogCallback methods ***
  43. STDMETHOD(InitDone) (THIS) PURE;
  44. STDMETHOD(SelectionChange) (THIS) PURE;
  45. STDMETHOD(HandleMessage) (THIS_ HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult) PURE;
  46. };
  47. //
  48. // Result action ids for PrintDlgEx.
  49. //
  50. #define PD_RESULT_CANCEL 0
  51. #define PD_RESULT_PRINT 1
  52. #define PD_RESULT_APPLY 2
  53. #define START_PAGE_GENERAL 0xffffffff
  54. //
  55. // Page Range structure for PrintDlgEx.
  56. //
  57. typedef struct tagPRINTPAGERANGE {
  58. DWORD nFromPage;
  59. DWORD nToPage;
  60. } PRINTPAGERANGE, *LPPRINTPAGERANGE;
  61. //
  62. // PrintDlgEx structure.
  63. //
  64. typedef struct tagPDEXA {
  65. DWORD lStructSize; // size of structure in bytes
  66. HWND hwndOwner; // caller's window handle
  67. HGLOBAL hDevMode; // handle to DevMode
  68. HGLOBAL hDevNames; // handle to DevNames
  69. HDC hDC; // printer DC/IC or NULL
  70. DWORD Flags; // PD_ flags
  71. DWORD Flags2; // reserved
  72. DWORD ExclusionFlags; // items to exclude from driver pages
  73. DWORD nPageRanges; // number of page ranges
  74. DWORD nMaxPageRanges; // max number of page ranges
  75. LPPRINTPAGERANGE lpPageRanges; // array of page ranges
  76. DWORD nMinPage; // min page number
  77. DWORD nMaxPage; // max page number
  78. DWORD nCopies; // number of copies
  79. HINSTANCE hInstance; // instance handle
  80. LPCSTR lpPrintTemplateName; // template name for app specific area
  81. LPUNKNOWN lpCallback; // app callback interface
  82. DWORD nPropertyPages; // number of app property pages in lphPropertyPages
  83. HPROPSHEETPAGE *lphPropertyPages; // array of app property page handles
  84. DWORD nStartPage; // start page id
  85. DWORD dwResultAction; // result action if S_OK is returned
  86. } PRINTDLGEXA, *LPPRINTDLGEXA;
  87. //
  88. // PrintDlgEx structure.
  89. //
  90. typedef struct tagPDEXW {
  91. DWORD lStructSize; // size of structure in bytes
  92. HWND hwndOwner; // caller's window handle
  93. HGLOBAL hDevMode; // handle to DevMode
  94. HGLOBAL hDevNames; // handle to DevNames
  95. HDC hDC; // printer DC/IC or NULL
  96. DWORD Flags; // PD_ flags
  97. DWORD Flags2; // reserved
  98. DWORD ExclusionFlags; // items to exclude from driver pages
  99. DWORD nPageRanges; // number of page ranges
  100. DWORD nMaxPageRanges; // max number of page ranges
  101. LPPRINTPAGERANGE lpPageRanges; // array of page ranges
  102. DWORD nMinPage; // min page number
  103. DWORD nMaxPage; // max page number
  104. DWORD nCopies; // number of copies
  105. HINSTANCE hInstance; // instance handle
  106. LPCWSTR lpPrintTemplateName; // template name for app specific area
  107. LPUNKNOWN lpCallback; // app callback interface
  108. DWORD nPropertyPages; // number of app property pages in lphPropertyPages
  109. HPROPSHEETPAGE *lphPropertyPages; // array of app property page handles
  110. DWORD nStartPage; // start page id
  111. DWORD dwResultAction; // result action if S_OK is returned
  112. } PRINTDLGEXW, *LPPRINTDLGEXW;
  113. #ifdef UNICODE
  114. typedef PRINTDLGEXW PRINTDLGEX;
  115. typedef LPPRINTDLGEXW LPPRINTDLGEX;
  116. #else
  117. typedef PRINTDLGEXA PRINTDLGEX;
  118. typedef LPPRINTDLGEXA LPPRINTDLGEX;
  119. #endif // UNICODE
  120. #endif
  121. class C_PrintDialogEx : public CPrintDialog
  122. {
  123. DECLARE_DYNAMIC(C_PrintDialogEx)
  124. BEGIN_INTERFACE_PART(PrintDialogCallback, IPrintDialogCallback)
  125. INIT_INTERFACE_PART(C_PrintDialogEx, PrintDialogCallback)
  126. STDMETHOD(InitDone)();
  127. STDMETHOD(SelectionChange)();
  128. STDMETHOD(HandleMessage)(HWND, UINT, WPARAM, LPARAM, LRESULT*);
  129. END_INTERFACE_PART(PrintDialogCallback)
  130. DECLARE_INTERFACE_MAP()
  131. public:
  132. C_PrintDialogEx(BOOL bPrintSetupOnly,
  133. DWORD dwFlags = PD_ALLPAGES | PD_USEDEVMODECOPIES
  134. | PD_NOPAGENUMS | PD_HIDEPRINTTOFILE | PD_NOSELECTION,
  135. CWnd* pParentWnd = NULL);
  136. virtual INT_PTR DoModal();
  137. virtual HRESULT OnInitDone();
  138. virtual HRESULT OnSelectionChange();
  139. virtual HRESULT OnHandleMessage(HWND hDlg, UINT uMsg, WPARAM wParam,
  140. LPARAM lParam, LRESULT* pResult);
  141. PRINTDLGEX m_pdex;
  142. };
  143. #endif