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.

242 lines
7.2 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. faxui.h
  5. Abstract:
  6. Print Wizard user interface header file
  7. Environment:
  8. Fax driver user interface
  9. Revision History:
  10. 01/09/96 -davidx-
  11. Created it.
  12. dd-mm-yy -author-
  13. description
  14. --*/
  15. #ifndef _FAXUI_H_
  16. #define _FAXUI_H_
  17. #include <windows.h>
  18. #include <fxsapip.h>
  19. #include "faxlib.h"
  20. #include <winddiui.h>
  21. #include <commctrl.h>
  22. #include <windowsx.h>
  23. #include <prsht.h>
  24. #ifdef FAX_SCAN_ENABLED
  25. #include <twain.h>
  26. #endif
  27. #include "registry.h"
  28. #include "coverpg.h"
  29. #include "resource.h"
  30. #include "faxsendw.h"
  31. //
  32. // Display an error message dialog
  33. //
  34. INT
  35. DisplayMessageDialog(
  36. HWND hwndParent,
  37. UINT type,
  38. INT formatStrId,
  39. INT titleStrId,
  40. ...
  41. );
  42. #define MAX_TITLE_LEN 128
  43. #define MAX_FORMAT_LEN 128
  44. #define MAX_MESSAGE_LEN 512
  45. //
  46. // Information about each recipient
  47. //
  48. typedef struct RECIPIENT_TAG
  49. {
  50. struct RECIPIENT_TAG* pNext; // Points to next recipient
  51. LPTSTR pName; // Recipient name
  52. LPTSTR pAddress; // Recipient address
  53. LPTSTR pCountry; // Recipient country
  54. DWORD dwCountryId; // Recipient country ID
  55. BOOL bUseDialingRules; // Don't dial the number as entered - use dialing rules (TAPI / Outbound routing) instead
  56. DWORD dwDialingRuleId; // If bUseDialingRules==TRUE, holds the dialing rule to use (see lineSetCurrentLocation)
  57. LPVOID lpEntryId; // Recipient MAPI/WAB EntryId after resolution
  58. DWORD cbEntryId; // Size of EntryId
  59. BOOL bFromAddressBook; // TRUE if the recipient is from address book
  60. } RECIPIENT, *PRECIPIENT;
  61. // Data structures used by the user mode DLL to associate private
  62. // information with a printer device context (PDEV to be exactly)
  63. //
  64. typedef struct {
  65. BOOL finishPressed; // User pressed Finish in fax wizard pages
  66. PVOID pCPInfo; // For managing cover pages
  67. LPVOID lpWabInit; // pointer to wab object
  68. LPVOID lpMAPIabInit; // pointer to MPAI ab object
  69. DWORD noteSubjectFlag; // Whether note/subject fields are present on cover page
  70. SHORT cpPaperSize; // Cover page paper size
  71. SHORT cpOrientation; // Cover page orientation
  72. #ifdef FAX_SCAN_ENABLED
  73. HWND hDlgScan; // scanning wizard page
  74. HMODULE hTwain; // module handle for twain dll
  75. DSMENTRYPROC pDsmEntry; // pointer to the twain data source manager proc
  76. TW_IDENTITY AppId; // application id/handle for twain
  77. TW_IDENTITY DataSource; // application id/handle for twain
  78. HWND hWndTwain; // window handle for twain
  79. HANDLE hEvent; //
  80. HANDLE hEventQuit; //
  81. HANDLE hEventXfer; //
  82. HANDLE hThread; //
  83. BOOL TwainCancelled; // TRUE if twain UI was canceled
  84. HANDLE hTwainEvent; // signals twain detection complete
  85. BOOL TwainAvail; //
  86. BOOL TwainActive; //
  87. DWORD State; //
  88. #endif
  89. BOOL ServerCPOnly; //
  90. HANDLE hCPEvent; // signals fax service query for cp complete
  91. HANDLE hCountryListEvent; // signals country list enumeration complete
  92. HANDLE hTAPIEvent; // signals TAPI init complete
  93. TCHAR FileName[MAX_PATH]; //
  94. DWORD PageCount; //
  95. HFONT hLargeFont; // large bold font for wizard 97
  96. PVOID signature; // Signature
  97. BOOL isLocalPrinter; // whether the printer is local
  98. BOOL bSendCoverPage;
  99. PRECIPIENT pRecipients; // List of recipients
  100. UINT nRecipientCount; // Number of recipients
  101. DWORD dwFlags;
  102. DWORD dwRights; // Access rights
  103. DWORD dwQueueStates; // Queue state
  104. DWORD dwSupportedReceipts; // Receipts supported by server
  105. DWORD dwRecipientsLimit; // Recipient limit for a single broadcast job.
  106. PFAX_TAPI_LINECOUNTRY_LIST pCountryList;
  107. LPTSTR lptstrServerName;
  108. LPTSTR lptstrPrinterName;
  109. LPFAX_SEND_WIZARD_DATA lpInitialData;
  110. LPFAX_SEND_WIZARD_DATA lpFaxSendWizardData;
  111. WNDPROC wpOrigStaticControlProc; // Pointer to the original static control window procedure
  112. // we subclass to support cover page preview.
  113. DWORD dwComCtrlVer; // The version of COMCTRL32.DLL
  114. HFONT hTitleFont;
  115. TCHAR szTempPreviewTiff[MAX_PATH]; // The name of the temp preview tiff we pass to the viewer
  116. HANDLE hFaxPreviewProcess; // The process handle of the tiff viewer
  117. } WIZARDUSERMEM, *PWIZARDUSERMEM;
  118. #define ValidPDEVWizardUserMem(p) \
  119. ((p) && (p) == (p)->signature)
  120. //
  121. // Mark the user mode memory structure
  122. //
  123. #define MarkPDEVWizardUserMem(p) \
  124. { (p)->signature = (p); }
  125. //
  126. // Free up the list of recipients associated with each fax job
  127. //
  128. VOID
  129. FreeRecipientList(
  130. PWIZARDUSERMEM pStrUserMem
  131. );
  132. #define FreeRecipient(pRecipient) { \
  133. MemFree(pRecipient->pName); \
  134. MemFree(pRecipient->pAddress); \
  135. MemFree(pRecipient->pCountry); \
  136. if (!pRecipient->bFromAddressBook && pRecipient->lpEntryId)\
  137. FreeEntryID(pWizardUserMem,pRecipient->lpEntryId); \
  138. MemFree(pRecipient); \
  139. }
  140. //
  141. // Global variable declarations
  142. //
  143. extern HANDLE g_hModule; // DLL instance handle
  144. extern HANDLE g_hResource; // Resource DLL instance handle
  145. extern BOOL oleInitialized;
  146. BOOL InitializeDll();
  147. VOID UnInitializeDll();
  148. DWORD
  149. AsyncWizardThread(
  150. PBYTE param
  151. );
  152. BOOL
  153. InitializeTwain(
  154. PWIZARDUSERMEM pWizardUserMem
  155. );
  156. HRESULT WINAPI
  157. FaxFreePersonalProfileInformation(
  158. PFAX_PERSONAL_PROFILE lpPersonalProfileInfo
  159. );
  160. HRESULT WINAPI
  161. FaxFreePersonalProfileInformation(
  162. PFAX_PERSONAL_PROFILE lpPersonalProfileInfo
  163. );
  164. HRESULT WINAPI
  165. FaxFreeSendWizardData(
  166. LPFAX_SEND_WIZARD_DATA lpFaxSendWizardData
  167. );
  168. HRESULT WINAPI
  169. FaxSendWizardUI(
  170. IN DWORD hWndOwner,
  171. IN DWORD dwFlags,
  172. IN LPTSTR lptstrServerName,
  173. IN LPTSTR lptstrPrinterName,
  174. IN LPFAX_SEND_WIZARD_DATA lpInitialData,
  175. OUT LPTSTR lptstrTifName,
  176. IN UINT cchstrTifName,
  177. OUT LPFAX_SEND_WIZARD_DATA lpFaxSendWizardData
  178. );
  179. #define MyHideWindow(_hwnd) SetWindowLong((_hwnd),GWL_STYLE,GetWindowLong((_hwnd),GWL_STYLE)&~WS_VISIBLE)
  180. #endif // !_FAXUI_H_