JwaWinFax.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:72k
源码类别:

Windows编程

开发平台:

Delphi

  1. {******************************************************************************}
  2. {                                                                       }
  3. { Windows FAX API interface unit for Object Pascal                             }
  4. {                                                                       }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
  6. { Corporation. All Rights Reserved.                                            }
  7. {                 }
  8. { The original file is: winfax.h, released November 2001. The original Pascal  }
  9. { code is: WinFax.pas, released April 2002. The initial developer of the       }
  10. { Pascal code is Marcel van Brakel (brakelm@chello.nl).                        }
  11. {                                                                              }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
  13. { Marcel van Brakel. All Rights Reserved.                                      }
  14. {                 }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  16. {                }
  17. { You may retrieve the latest version of this file at the Project JEDI home    }
  18. { page, located at http://delphi-jedi.org or my personal homepage located at   }
  19. { http://members.chello.nl/m.vanbrakel2                                        }
  20. {                }
  21. { The contents of this file are used with permission, subject to the Mozilla   }
  22. { Public License Version 1.1 (the "License"); you may not use this file except }
  23. { in compliance with the License. You may obtain a copy of the License at      }
  24. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  25. {                                                                              }
  26. { Software distributed under the License is distributed on an "AS IS" basis,   }
  27. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  28. { the specific language governing rights and limitations under the License.    }
  29. {                                                                              }
  30. { Alternatively, the contents of this file may be used under the terms of the  }
  31. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  32. { provisions of the LGPL License are applicable instead of those above.        }
  33. { If you wish to allow use of your version of this file only under the terms   }
  34. { of the LGPL License and not to allow others to use your version of this file }
  35. { under the MPL, indicate your decision by deleting  the provisions above and  }
  36. { replace  them with the notice and other provisions required by the LGPL      }
  37. { License.  If you do not delete the provisions above, a recipient may use     }
  38. { your version of this file under either the MPL or the LGPL License.          }
  39. {                 }
  40. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  41. {                 }
  42. {******************************************************************************}
  43. unit JwaWinFax;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "winfax.h"'}
  47. {$HPPEMIT ''}
  48. {$I WINDEFINES.INC}
  49. interface
  50. uses
  51.   JwaWinType, JwaWinError, JwaWinBase, JwaWinNT;
  52. //
  53. // FAX ERROR CODES
  54. //
  55. const
  56.   FAX_ERR_START = 7001; // First fax specific error code
  57.   {$EXTERNALSYM FAX_ERR_START}
  58.   FAX_ERR_SRV_OUTOFMEMORY           = 7001;
  59.   {$EXTERNALSYM FAX_ERR_SRV_OUTOFMEMORY}
  60.   FAX_ERR_GROUP_NOT_FOUND           = 7002;
  61.   {$EXTERNALSYM FAX_ERR_GROUP_NOT_FOUND}
  62.   FAX_ERR_BAD_GROUP_CONFIGURATION   = 7003;
  63.   {$EXTERNALSYM FAX_ERR_BAD_GROUP_CONFIGURATION}
  64.   FAX_ERR_GROUP_IN_USE              = 7004;
  65.   {$EXTERNALSYM FAX_ERR_GROUP_IN_USE}
  66.   FAX_ERR_RULE_NOT_FOUND            = 7005;
  67.   {$EXTERNALSYM FAX_ERR_RULE_NOT_FOUND}
  68.   FAX_ERR_NOT_NTFS                  = 7006;
  69.   {$EXTERNALSYM FAX_ERR_NOT_NTFS}
  70.   FAX_ERR_DIRECTORY_IN_USE          = 7007;
  71.   {$EXTERNALSYM FAX_ERR_DIRECTORY_IN_USE}
  72.   FAX_ERR_FILE_ACCESS_DENIED        = 7008;
  73.   {$EXTERNALSYM FAX_ERR_FILE_ACCESS_DENIED}
  74.   FAX_ERR_MESSAGE_NOT_FOUND         = 7009;
  75.   {$EXTERNALSYM FAX_ERR_MESSAGE_NOT_FOUND}
  76.   FAX_ERR_DEVICE_NUM_LIMIT_EXCEEDED = 7010;
  77.   {$EXTERNALSYM FAX_ERR_DEVICE_NUM_LIMIT_EXCEEDED}
  78.   FAX_ERR_NOT_SUPPORTED_ON_THIS_SKU = 7011;
  79.   {$EXTERNALSYM FAX_ERR_NOT_SUPPORTED_ON_THIS_SKU}
  80.   FAX_ERR_VERSION_MISMATCH          = 7012; // Fax client/server versions mismtach
  81.   {$EXTERNALSYM FAX_ERR_VERSION_MISMATCH}
  82.   FAX_ERR_RECIPIENTS_LIMIT          = 7013; // Recipients limit in a single broadcast
  83.   {$EXTERNALSYM FAX_ERR_RECIPIENTS_LIMIT}
  84.   FAX_ERR_END = 7013; // Last fax specific error code
  85.   {$EXTERNALSYM FAX_ERR_END}
  86. //
  87. // MessageId: FAX_E_SRV_OUTOFMEMORY
  88. //
  89. // MessageText:
  90. //
  91. //  The fax server failed to allocate memory.
  92. //
  93.   FAX_E_SRV_OUTOFMEMORY = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_SRV_OUTOFMEMORY);
  94.   {$EXTERNALSYM FAX_E_SRV_OUTOFMEMORY}
  95. //
  96. // MessageId: FAX_E_GROUP_NOT_FOUND
  97. //
  98. // MessageText:
  99. //
  100. //  The fax server failed to locate an outbound routing group by name.
  101. //
  102.   FAX_E_GROUP_NOT_FOUND = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_GROUP_NOT_FOUND);
  103.   {$EXTERNALSYM FAX_E_GROUP_NOT_FOUND}
  104. //
  105. // MessageId: FAX_E_BAD_GROUP_CONFIGURATION
  106. //
  107. // MessageText:
  108. //
  109. //  The fax server encountered an outbound routing group with bad configuration.
  110. //
  111.   FAX_E_BAD_GROUP_CONFIGURATION = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_BAD_GROUP_CONFIGURATION);
  112.   {$EXTERNALSYM FAX_E_BAD_GROUP_CONFIGURATION}
  113. //
  114. // MessageId: FAX_E_GROUP_IN_USE
  115. //
  116. // MessageText:
  117. //
  118. //  The fax server cannot remove an outbound routing group because it is in use by one or more outbound routing rules.
  119. //
  120.   FAX_E_GROUP_IN_USE = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_GROUP_IN_USE);
  121.   {$EXTERNALSYM FAX_E_GROUP_IN_USE}
  122. //
  123. // MessageId: FAX_E_RULE_NOT_FOUND
  124. //
  125. // MessageText:
  126. //
  127. //  The fax server failed to locate an outbound routing rule by country code and area code.
  128. //
  129.   FAX_E_RULE_NOT_FOUND = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_RULE_NOT_FOUND);
  130.   {$EXTERNALSYM FAX_E_RULE_NOT_FOUND}
  131. //
  132. // MessageId: FAX_E_NOT_NTFS
  133. //
  134. // MessageText:
  135. //
  136. //  The fax server cannot set an archive folder to a non-NTFS partition.
  137. //
  138.   FAX_E_NOT_NTFS = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_NOT_NTFS);
  139.   {$EXTERNALSYM FAX_E_NOT_NTFS}
  140. //
  141. // MessageId: FAX_E_DIRECTORY_IN_USE
  142. //
  143. // MessageText:
  144. //
  145. //  The fax server cannot use the same folder for both the inbox and the sent-items archives.
  146. //
  147.   FAX_E_DIRECTORY_IN_USE = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_DIRECTORY_IN_USE);
  148.   {$EXTERNALSYM FAX_E_DIRECTORY_IN_USE}
  149. //
  150. // MessageId: FAX_E_FILE_ACCESS_DENIED
  151. //
  152. // MessageText:
  153. //
  154. //  The fax server cannot access the specified file or folder.
  155. //
  156.   FAX_E_FILE_ACCESS_DENIED = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_FILE_ACCESS_DENIED);
  157.   {$EXTERNALSYM FAX_E_FILE_ACCESS_DENIED}
  158. //
  159. // MessageId: FAX_E_MESSAGE_NOT_FOUND
  160. //
  161. // MessageText:
  162. //
  163. //  The fax server cannot find the job or message by its ID.
  164. //
  165.   FAX_E_MESSAGE_NOT_FOUND = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_MESSAGE_NOT_FOUND);
  166.   {$EXTERNALSYM FAX_E_MESSAGE_NOT_FOUND}
  167. //
  168. // MessageId: FAX_E_DEVICE_NUM_LIMIT_EXCEEDED
  169. //
  170. // MessageText:
  171. //
  172. //  The fax server cannot complete the operation because the number of active fax devices allowed for this version of Windows was exceeded.
  173. //
  174.   FAX_E_DEVICE_NUM_LIMIT_EXCEEDED = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_DEVICE_NUM_LIMIT_EXCEEDED);
  175.   {$EXTERNALSYM FAX_E_DEVICE_NUM_LIMIT_EXCEEDED}
  176. //
  177. // MessageId: FAX_E_NOT_SUPPORTED_ON_THIS_SKU
  178. //
  179. // MessageText:
  180. //
  181. //  The fax server cannot complete the operation because it is not supported for this version of Windows.
  182. //
  183.   FAX_E_NOT_SUPPORTED_ON_THIS_SKU = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_NOT_SUPPORTED_ON_THIS_SKU);
  184.   {$EXTERNALSYM FAX_E_NOT_SUPPORTED_ON_THIS_SKU}
  185. //
  186. // MessageId: FAX_E_VERSION_MISMATCH
  187. //
  188. // MessageText:
  189. //
  190. //  The fax server API version does not support the requested operation.
  191. //
  192.   FAX_E_VERSION_MISMATCH = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_VERSION_MISMATCH);
  193.   {$EXTERNALSYM FAX_E_VERSION_MISMATCH}
  194. //
  195. // MessageId: FAX_E_RECIPIENT_LIMIT
  196. //
  197. // MessageText:
  198. //
  199. // The limit on the number of recipients for a single fax broadcast was reached.
  200. //
  201.   FAX_E_RECIPIENTS_LIMIT = HRESULT((SEVERITY_ERROR shl 31) or (FACILITY_ITF shl 16) or FAX_ERR_RECIPIENTS_LIMIT);
  202.   {$EXTERNALSYM FAX_E_RECIPIENTS_LIMIT}
  203. type
  204.   FAX_ENUM_LOG_LEVELS = (
  205.     FAXLOG_LEVEL_NONE,
  206.     FAXLOG_LEVEL_MIN,
  207.     FAXLOG_LEVEL_MED,
  208.     FAXLOG_LEVEL_MAX);
  209.   {$EXTERNALSYM FAX_ENUM_LOG_LEVELS}
  210.   TFaxEnumLogLevels = FAX_ENUM_LOG_LEVELS;
  211.   FAX_ENUM_LOG_CATEGORIES = (
  212.     FAXLOG_CATEGORY_FILLER0,
  213.     FAXLOG_CATEGORY_INIT,                   // Initialization / shutdown
  214.     FAXLOG_CATEGORY_OUTBOUND,               // Outbound messages
  215.     FAXLOG_CATEGORY_INBOUND,                // Inbound messages
  216.     FAXLOG_CATEGORY_UNKNOWN);               // Unknown category (all others)
  217.   {$EXTERNALSYM FAX_ENUM_LOG_CATEGORIES}
  218.   TFaxEnumLogCategories = FAX_ENUM_LOG_CATEGORIES;
  219.   PFAX_LOG_CATEGORYA = ^FAX_LOG_CATEGORYA;
  220.   {$EXTERNALSYM PFAX_LOG_CATEGORYA}
  221.   _FAX_LOG_CATEGORYA = record
  222.     Name: LPCSTR; // logging category name
  223.     Category: DWORD; // logging category number
  224.     Level: DWORD; // logging level for the category
  225.   end;
  226.   {$EXTERNALSYM _FAX_LOG_CATEGORYA}
  227.   FAX_LOG_CATEGORYA = _FAX_LOG_CATEGORYA;
  228.   {$EXTERNALSYM FAX_LOG_CATEGORYA}
  229.   TFaxLogCategoryA = FAX_LOG_CATEGORYA;
  230.   PFaxLogCategoryA = PFAX_LOG_CATEGORYA;
  231.   PFAX_LOG_CATEGORYW = ^FAX_LOG_CATEGORYW;
  232.   {$EXTERNALSYM PFAX_LOG_CATEGORYW}
  233.   _FAX_LOG_CATEGORYW = record
  234.     Name: LPCWSTR; // logging category name
  235.     Category: DWORD; // logging category number
  236.     Level: DWORD; // logging level for the category
  237.   end;
  238.   {$EXTERNALSYM _FAX_LOG_CATEGORYW}
  239.   FAX_LOG_CATEGORYW = _FAX_LOG_CATEGORYW;
  240.   {$EXTERNALSYM FAX_LOG_CATEGORYW}
  241.   TFaxLogCategoryW = FAX_LOG_CATEGORYW;
  242.   PFaxLogCategoryW = PFAX_LOG_CATEGORYW;
  243. {$IFDEF UNICODE}
  244.   FAX_LOG_CATEGORY = FAX_LOG_CATEGORYW;
  245.   {$EXTERNALSYM FAX_LOG_CATEGORY}
  246.   PFAX_LOG_CATEGORY = PFAX_LOG_CATEGORYW;
  247.   {$EXTERNALSYM PFAX_LOG_CATEGORY}
  248.   TFaxLogCategory = TFaxLogCategoryW;
  249.   PFaxLogCategory = PFaxLogCategoryW;
  250. {$ELSE}
  251.   FAX_LOG_CATEGORY = FAX_LOG_CATEGORYA;
  252.   {$EXTERNALSYM FAX_LOG_CATEGORY}
  253.   PFAX_LOG_CATEGORY = PFAX_LOG_CATEGORYA;
  254.   {$EXTERNALSYM PFAX_LOG_CATEGORY}
  255.   TFaxLogCategory = TFaxLogCategoryA;
  256.   PFaxLogCategory = PFaxLogCategoryA;
  257. {$ENDIF}
  258.   PFAX_TIME = ^FAX_TIME;
  259.   {$EXTERNALSYM PFAX_TIME}
  260.   _FAX_TIME = record
  261.     Hour: WORD;
  262.     Minute: WORD;
  263.   end;
  264.   {$EXTERNALSYM _FAX_TIME}
  265.   FAX_TIME = _FAX_TIME;
  266.   {$EXTERNALSYM FAX_TIME}
  267.   TFaxTime = FAX_TIME;
  268.   PFaxTime = PFAX_TIME;
  269.   PFAX_CONFIGURATIONA = ^FAX_CONFIGURATIONA;
  270.   {$EXTERNALSYM PFAX_CONFIGURATIONA}
  271.   _FAX_CONFIGURATIONA = record
  272.     SizeOfStruct: DWORD; // size of this structure
  273.     Retries: DWORD; // number of retries for fax send
  274.     RetryDelay: DWORD; // number of minutes between retries
  275.     DirtyDays: DWORD; // number of days to keep an unsent job in the queue
  276.     Branding: BOOL; // fsp should brand outgoing faxes
  277.     UseDeviceTsid: BOOL; // server uses device tsid only
  278.     ServerCp: BOOL; // clients must use cover pages on the server
  279.     PauseServerQueue: BOOL; // is the server queue paused?
  280.     StartCheapTime: FAX_TIME; // start of discount rate period
  281.     StopCheapTime: FAX_TIME; // end of discount rate period
  282.     ArchiveOutgoingFaxes: BOOL; // whether outgoing faxes should be archived
  283.     ArchiveDirectory: LPCSTR; // archive directory for outgoing faxes
  284.     Reserved: LPCSTR; // Reserved; must be NULL
  285.   end;
  286.   {$EXTERNALSYM _FAX_CONFIGURATIONA}
  287.   FAX_CONFIGURATIONA = _FAX_CONFIGURATIONA;
  288.   {$EXTERNALSYM FAX_CONFIGURATIONA}
  289.   TFaxConfigurationA = FAX_CONFIGURATIONA;
  290.   PFaxConfigurationA = PFAX_CONFIGURATIONA;
  291.   PFAX_CONFIGURATIONW = ^FAX_CONFIGURATIONW;
  292.   {$EXTERNALSYM PFAX_CONFIGURATIONW}
  293.   _FAX_CONFIGURATIONW = record
  294.     SizeOfStruct: DWORD; // size of this structure
  295.     Retries: DWORD; // number of retries for fax send
  296.     RetryDelay: DWORD; // number of minutes between retries
  297.     DirtyDays: DWORD; // number of days to keep an unsent job in the queue
  298.     Branding: BOOL; // fsp should brand outgoing faxes
  299.     UseDeviceTsid: BOOL; // server uses device tsid only
  300.     ServerCp: BOOL; // clients must use cover pages on the server
  301.     PauseServerQueue: BOOL; // is the server queue paused?
  302.     StartCheapTime: FAX_TIME; // start of discount rate period
  303.     StopCheapTime: FAX_TIME; // end of discount rate period
  304.     ArchiveOutgoingFaxes: BOOL; // whether outgoing faxes should be archived
  305.     ArchiveDirectory: LPCWSTR; // archive directory for outgoing faxes
  306.     Reserved: LPCWSTR; // Reserved; must be NULL
  307.   end;
  308.   {$EXTERNALSYM _FAX_CONFIGURATIONW}
  309.   FAX_CONFIGURATIONW = _FAX_CONFIGURATIONW;
  310.   {$EXTERNALSYM FAX_CONFIGURATIONW}
  311.   TFaxConfigurationW = FAX_CONFIGURATIONW;
  312.   PFaxConfigurationW = PFAX_CONFIGURATIONW;
  313. {$IFDEF UNICODE}
  314.   FAX_CONFIGURATION = FAX_CONFIGURATIONW;
  315.   {$EXTERNALSYM FAX_CONFIGURATION}
  316.   PFAX_CONFIGURATION = PFAX_CONFIGURATIONW;
  317.   {$EXTERNALSYM PFAX_CONFIGURATION}
  318.   TFaxConfiguration = TFaxConfigurationW;
  319.   PFaxConfiguration = PFaxConfigurationW;
  320. {$ELSE}
  321.   FAX_CONFIGURATION = FAX_CONFIGURATIONA;
  322.   {$EXTERNALSYM FAX_CONFIGURATION}
  323.   PFAX_CONFIGURATION = PFAX_CONFIGURATIONA;
  324.   {$EXTERNALSYM PFAX_CONFIGURATION}
  325.   TFaxConfiguration = TFaxConfigurationA;
  326.   PFaxConfiguration = PFaxConfigurationA;
  327. {$ENDIF}
  328. //
  329. // FaxSetJob() command codes
  330. //
  331.   FAX_ENUM_JOB_COMMANDS = (
  332.     JC_UNKNOWN,
  333.     JC_DELETE,
  334.     JC_PAUSE,
  335.     JC_RESUME);
  336.   {$EXTERNALSYM FAX_ENUM_JOB_COMMANDS}
  337.   TFaxEnumJobCommands = FAX_ENUM_JOB_COMMANDS;
  338. const
  339.   JC_RESTART = JC_RESUME;
  340.   {$EXTERNALSYM JC_RESTART}
  341. //
  342. // job type defines
  343. //
  344.   JT_UNKNOWN      = 0;
  345.   {$EXTERNALSYM JT_UNKNOWN}
  346.   JT_SEND         = 1;
  347.   {$EXTERNALSYM JT_SEND}
  348.   JT_RECEIVE      = 2;
  349.   {$EXTERNALSYM JT_RECEIVE}
  350.   JT_ROUTING      = 3;
  351.   {$EXTERNALSYM JT_ROUTING}
  352.   JT_FAIL_RECEIVE = 4;
  353.   {$EXTERNALSYM JT_FAIL_RECEIVE}
  354. //
  355. // job status defines
  356. //
  357.   JS_PENDING          = $00000000;
  358.   {$EXTERNALSYM JS_PENDING}
  359.   JS_INPROGRESS       = $00000001;
  360.   {$EXTERNALSYM JS_INPROGRESS}
  361.   JS_DELETING         = $00000002;
  362.   {$EXTERNALSYM JS_DELETING}
  363.   JS_FAILED           = $00000004;
  364.   {$EXTERNALSYM JS_FAILED}
  365.   JS_PAUSED           = $00000008;
  366.   {$EXTERNALSYM JS_PAUSED}
  367.   JS_NOLINE           = $00000010;
  368.   {$EXTERNALSYM JS_NOLINE}
  369.   JS_RETRYING         = $00000020;
  370.   {$EXTERNALSYM JS_RETRYING}
  371.   JS_RETRIES_EXCEEDED = $00000040;
  372.   {$EXTERNALSYM JS_RETRIES_EXCEEDED}
  373. type
  374.   PFAX_DEVICE_STATUSA = ^FAX_DEVICE_STATUSA;
  375.   {$EXTERNALSYM PFAX_DEVICE_STATUSA}
  376.   _FAX_DEVICE_STATUSA = record
  377.     SizeOfStruct: DWORD; // size of this structure
  378.     CallerId: LPCSTR; // caller id string
  379.     Csid: LPCSTR; // station identifier
  380.     CurrentPage: DWORD; // current page
  381.     DeviceId: DWORD; // permanent line id
  382.     DeviceName: LPCSTR; // device name
  383.     DocumentName: LPCSTR; // document name
  384.     JobType: DWORD; // send or receive?
  385.     PhoneNumber: LPCSTR; // sending phone number
  386.     RoutingString: LPCSTR; // routing information
  387.     SenderName: LPCSTR; // sender name
  388.     RecipientName: LPCSTR; // recipient name
  389.     Size: DWORD; // size in bytes of the document
  390.     StartTime: FILETIME; // starting time of the fax send/receive
  391.     Status: DWORD; // current status of the device, see FPS_??? masks
  392.     StatusString: LPCSTR; // status string if the Status field is zero.  this may be NULL.
  393.     SubmittedTime: FILETIME; // time the document was submitted
  394.     TotalPages: DWORD; // total number of pages in this job
  395.     Tsid: LPCSTR; // transmitting station identifier
  396.     UserName: LPCSTR; // user that submitted the active job
  397.   end;
  398.   {$EXTERNALSYM _FAX_DEVICE_STATUSA}
  399.   FAX_DEVICE_STATUSA = _FAX_DEVICE_STATUSA;
  400.   {$EXTERNALSYM FAX_DEVICE_STATUSA}
  401.   TFaxDeviceStatusA = FAX_DEVICE_STATUSA;
  402.   PFaxDeviceStatusA = PFAX_DEVICE_STATUSA;
  403.   PFAX_DEVICE_STATUSW = ^FAX_DEVICE_STATUSW;
  404.   {$EXTERNALSYM PFAX_DEVICE_STATUSW}
  405.   _FAX_DEVICE_STATUSW = record
  406.     SizeOfStruct: DWORD; // size of this structure
  407.     CallerId: LPCWSTR; // caller id string
  408.     Csid: LPCWSTR; // station identifier
  409.     CurrentPage: DWORD; // current page
  410.     DeviceId: DWORD; // permanent line id
  411.     DeviceName: LPCWSTR; // device name
  412.     DocumentName: LPCWSTR; // document name
  413.     JobType: DWORD; // send or receive?
  414.     PhoneNumber: LPCWSTR; // sending phone number
  415.     RoutingString: LPCWSTR; // routing information
  416.     SenderName: LPCWSTR; // sender name
  417.     RecipientName: LPCWSTR; // recipient name
  418.     Size: DWORD; // size in bytes of the document
  419.     StartTime: FILETIME; // starting time of the fax send/receive
  420.     Status: DWORD; // current status of the device, see FPS_??? masks
  421.     StatusString: LPCWSTR; // status string if the Status field is zero.  this may be NULL.
  422.     SubmittedTime: FILETIME; // time the document was submitted
  423.     TotalPages: DWORD; // total number of pages in this job
  424.     Tsid: LPCWSTR; // transmitting station identifier
  425.     UserName: LPCWSTR; // user that submitted the active job
  426.   end;
  427.   {$EXTERNALSYM _FAX_DEVICE_STATUSW}
  428.   FAX_DEVICE_STATUSW = _FAX_DEVICE_STATUSW;
  429.   {$EXTERNALSYM FAX_DEVICE_STATUSW}
  430.   TFaxDeviceStatusW = FAX_DEVICE_STATUSW;
  431.   PFaxDeviceStatusW = PFAX_DEVICE_STATUSW;
  432. {$IFDEF UNICODE}
  433.   FAX_DEVICE_STATUS = FAX_DEVICE_STATUSW;
  434.   {$EXTERNALSYM FAX_DEVICE_STATUS}
  435.   PFAX_DEVICE_STATUS = PFAX_DEVICE_STATUSW;
  436.   {$EXTERNALSYM PFAX_DEVICE_STATUS}
  437.   TFaxDeviceStatus = TFaxDeviceStatusW;
  438.   PFaxDeviceStatus = PFaxDeviceStatusW;
  439. {$ELSE}
  440.   FAX_DEVICE_STATUS = FAX_DEVICE_STATUSA;
  441.   {$EXTERNALSYM FAX_DEVICE_STATUS}
  442.   PFAX_DEVICE_STATUS = PFAX_DEVICE_STATUSA;
  443.   {$EXTERNALSYM PFAX_DEVICE_STATUS}
  444.   TFaxDeviceStatus = TFaxDeviceStatusA;
  445.   PFaxDeviceStatus = PFaxDeviceStatusA;
  446. {$ENDIF}
  447.   PFAX_JOB_ENTRYA = ^FAX_JOB_ENTRYA;
  448.   {$EXTERNALSYM PFAX_JOB_ENTRYA}
  449.   _FAX_JOB_ENTRYA = record
  450.     SizeOfStruct: DWORD; // size of this structure
  451.     JobId: DWORD; // fax job id
  452.     UserName: LPCSTR; // user who submitted the job
  453.     JobType: DWORD; // job type, see JT defines
  454.     QueueStatus: DWORD; // job queue status, see JS defines
  455.     Status: DWORD; // current status of the device, see FPS_??? masks
  456.     Size: DWORD; // size in bytes of the document
  457.     PageCount: DWORD; // total page count
  458.     RecipientNumber: LPCSTR; // recipient fax number
  459.     RecipientName: LPCSTR; // recipient name
  460.     Tsid: LPCSTR; // transmitter's id
  461.     SenderName: LPCSTR; // sender name
  462.     SenderCompany: LPCSTR; // sender company
  463.     SenderDept: LPCSTR; // sender department
  464.     BillingCode: LPCSTR; // billing code
  465.     ScheduleAction: DWORD; // when to schedule the fax, see JSA defines
  466.     ScheduleTime: SYSTEMTIME; // time to send the fax when JSA_SPECIFIC_TIME is used (must be local time)
  467.     DeliveryReportType: DWORD; // delivery report type, see DRT defines
  468.     DeliveryReportAddress: LPCSTR; // email address for delivery report (ndr or dr) thru MAPI / SMTP
  469.     DocumentName: LPCSTR; // document name
  470.   end;
  471.   {$EXTERNALSYM _FAX_JOB_ENTRYA}
  472.   FAX_JOB_ENTRYA = _FAX_JOB_ENTRYA;
  473.   {$EXTERNALSYM FAX_JOB_ENTRYA}
  474.   TFaxJobEntryA = FAX_JOB_ENTRYA;
  475.   PFaxJobEntryA = PFAX_JOB_ENTRYA;
  476.   PFAX_JOB_ENTRYW = ^FAX_JOB_ENTRYW;
  477.   {$EXTERNALSYM PFAX_JOB_ENTRYW}
  478.   _FAX_JOB_ENTRYW = record
  479.     SizeOfStruct: DWORD; // size of this structure
  480.     JobId: DWORD; // fax job id
  481.     UserName: LPCWSTR; // user who submitted the job
  482.     JobType: DWORD; // job type, see JT defines
  483.     QueueStatus: DWORD; // job queue status, see JS defines
  484.     Status: DWORD; // current status of the device, see FPS_??? masks
  485.     Size: DWORD; // size in bytes of the document
  486.     PageCount: DWORD; // total page count
  487.     RecipientNumber: LPCWSTR; // recipient fax number
  488.     RecipientName: LPCWSTR; // recipient name
  489.     Tsid: LPCWSTR; // transmitter's id
  490.     SenderName: LPCWSTR; // sender name
  491.     SenderCompany: LPCWSTR; // sender company
  492.     SenderDept: LPCWSTR; // sender department
  493.     BillingCode: LPCWSTR; // billing code
  494.     ScheduleAction: DWORD; // when to schedule the fax, see JSA defines
  495.     ScheduleTime: SYSTEMTIME; // time to send the fax when JSA_SPECIFIC_TIME is used (must be local time)
  496.     DeliveryReportType: DWORD; // delivery report type, see DRT defines
  497.     DeliveryReportAddress: LPCWSTR; // email address for delivery report (ndr or dr) thru MAPI / SMTP
  498.     DocumentName: LPCWSTR; // document name
  499.   end;
  500.   {$EXTERNALSYM _FAX_JOB_ENTRYW}
  501.   FAX_JOB_ENTRYW = _FAX_JOB_ENTRYW;
  502.   {$EXTERNALSYM FAX_JOB_ENTRYW}
  503.   TFaxJobEntryW = FAX_JOB_ENTRYW;
  504.   PFaxJobEntryW = PFAX_JOB_ENTRYW;
  505. {$IFDEF UNICODE}
  506.   FAX_JOB_ENTRY = FAX_JOB_ENTRYW;
  507.   {$EXTERNALSYM FAX_JOB_ENTRY}
  508.   PFAX_JOB_ENTRY = PFAX_JOB_ENTRYW;
  509.   {$EXTERNALSYM PFAX_JOB_ENTRY}
  510.   TFaxJobEntry = TFaxJobEntryW;
  511.   PFaxJobEntry = PFaxJobEntryW;
  512. {$ELSE}
  513.   FAX_JOB_ENTRY = FAX_JOB_ENTRYA;
  514.   {$EXTERNALSYM FAX_JOB_ENTRY}
  515.   PFAX_JOB_ENTRY = PFAX_JOB_ENTRYA;
  516.   {$EXTERNALSYM PFAX_JOB_ENTRY}
  517.   TFaxJobEntry = TFaxJobEntryA;
  518.   PFaxJobEntry = PFaxJobEntryA;
  519. {$ENDIF}
  520. //
  521. // fax port state masks
  522. //
  523. // if you change these defines the be sure to
  524. // change the resources in the fax service.
  525. //
  526. const
  527.   FPS_DIALING          = $20000001;
  528.   {$EXTERNALSYM FPS_DIALING}
  529.   FPS_SENDING          = $20000002;
  530.   {$EXTERNALSYM FPS_SENDING}
  531.   FPS_RECEIVING        = $20000004;
  532.   {$EXTERNALSYM FPS_RECEIVING}
  533.   FPS_COMPLETED        = $20000008;
  534.   {$EXTERNALSYM FPS_COMPLETED}
  535.   FPS_HANDLED          = $20000010;
  536.   {$EXTERNALSYM FPS_HANDLED}
  537.   FPS_UNAVAILABLE      = $20000020;
  538.   {$EXTERNALSYM FPS_UNAVAILABLE}
  539.   FPS_BUSY             = $20000040;
  540.   {$EXTERNALSYM FPS_BUSY}
  541.   FPS_NO_ANSWER        = $20000080;
  542.   {$EXTERNALSYM FPS_NO_ANSWER}
  543.   FPS_BAD_ADDRESS      = $20000100;
  544.   {$EXTERNALSYM FPS_BAD_ADDRESS}
  545.   FPS_NO_DIAL_TONE     = $20000200;
  546.   {$EXTERNALSYM FPS_NO_DIAL_TONE}
  547.   FPS_DISCONNECTED     = $20000400;
  548.   {$EXTERNALSYM FPS_DISCONNECTED}
  549.   FPS_FATAL_ERROR      = $20000800;
  550.   {$EXTERNALSYM FPS_FATAL_ERROR}
  551.   FPS_NOT_FAX_CALL     = $20001000;
  552.   {$EXTERNALSYM FPS_NOT_FAX_CALL}
  553.   FPS_CALL_DELAYED     = $20002000;
  554.   {$EXTERNALSYM FPS_CALL_DELAYED}
  555.   FPS_CALL_BLACKLISTED = $20004000;
  556.   {$EXTERNALSYM FPS_CALL_BLACKLISTED}
  557.   FPS_INITIALIZING     = $20008000;
  558.   {$EXTERNALSYM FPS_INITIALIZING}
  559.   FPS_OFFLINE          = $20010000;
  560.   {$EXTERNALSYM FPS_OFFLINE}
  561.   FPS_RINGING          = $20020000;
  562.   {$EXTERNALSYM FPS_RINGING}
  563.   FPS_AVAILABLE = $20100000;
  564.   {$EXTERNALSYM FPS_AVAILABLE}
  565.   FPS_ABORTING  = $20200000;
  566.   {$EXTERNALSYM FPS_ABORTING}
  567.   FPS_ROUTING   = $20400000;
  568.   {$EXTERNALSYM FPS_ROUTING}
  569.   FPS_ANSWERED  = $20800000;
  570.   {$EXTERNALSYM FPS_ANSWERED}
  571. //
  572. // fax port capability mask
  573. //
  574.   FPF_RECEIVE = $00000001; // Automatically receive faxes
  575.   {$EXTERNALSYM FPF_RECEIVE}
  576.   FPF_SEND    = $00000002;
  577.   {$EXTERNALSYM FPF_SEND}
  578.   FPF_VIRTUAL = $00000004;
  579.   {$EXTERNALSYM FPF_VIRTUAL}
  580. type
  581.   PFAX_PORT_INFOA = ^FAX_PORT_INFOA;
  582.   {$EXTERNALSYM PFAX_PORT_INFOA}
  583.   _FAX_PORT_INFOA = record
  584.     SizeOfStruct: DWORD; // size of this structure
  585.     DeviceId: DWORD; // Device ID
  586.     State: DWORD; // State of the device
  587.     Flags: DWORD; // Device specific flags
  588.     Rings: DWORD; // Number of rings before answer
  589.     Priority: DWORD; // Device priority
  590.     DeviceName: LPCSTR; // Device name
  591.     Tsid: LPCSTR; // Device Tsid
  592.     Csid: LPCSTR; // Device Csid
  593.   end;
  594.   {$EXTERNALSYM _FAX_PORT_INFOA}
  595.   FAX_PORT_INFOA = _FAX_PORT_INFOA;
  596.   {$EXTERNALSYM FAX_PORT_INFOA}
  597.   TFaxPortInfoA = FAX_PORT_INFOA;
  598.   PFaxPortInfoA = PFAX_PORT_INFOA;
  599.   PFAX_PORT_INFOW = ^FAX_PORT_INFOW;
  600.   {$EXTERNALSYM PFAX_PORT_INFOW}
  601.   _FAX_PORT_INFOW = record
  602.     SizeOfStruct: DWORD; // size of this structure
  603.     DeviceId: DWORD; // Device ID
  604.     State: DWORD; // State of the device
  605.     Flags: DWORD; // Device specific flags
  606.     Rings: DWORD; // Number of rings before answer
  607.     Priority: DWORD; // Device priority
  608.     DeviceName: LPCWSTR; // Device name
  609.     Tsid: LPCWSTR; // Device Tsid
  610.     Csid: LPCWSTR; // Device Csid
  611.   end;
  612.   {$EXTERNALSYM _FAX_PORT_INFOW}
  613.   FAX_PORT_INFOW = _FAX_PORT_INFOW;
  614.   {$EXTERNALSYM FAX_PORT_INFOW}
  615.   TFaxPortInfoW = FAX_PORT_INFOW;
  616.   PFaxPortInfoW = PFAX_PORT_INFOW;
  617. {$IFDEF UNICODE}
  618.   FAX_PORT_INFO = FAX_PORT_INFOW;
  619.   {$EXTERNALSYM FAX_PORT_INFO}
  620.   PFAX_PORT_INFO = PFAX_PORT_INFOW;
  621.   {$EXTERNALSYM PFAX_PORT_INFO}
  622.   TFaxPortInfo = TFaxPortInfoW;
  623.   PFaxPortInfo = PFaxPortInfoW;
  624. {$ELSE}
  625.   FAX_PORT_INFO = FAX_PORT_INFOA;
  626.   {$EXTERNALSYM FAX_PORT_INFO}
  627.   PFAX_PORT_INFO = PFAX_PORT_INFOA;
  628.   {$EXTERNALSYM PFAX_PORT_INFO}
  629.   TFaxPortInfo = TFaxPortInfoA;
  630.   PFaxPortInfo = PFaxPortInfoA;
  631. {$ENDIF}
  632.   PFAX_ROUTING_METHODA = ^FAX_ROUTING_METHODA;
  633.   {$EXTERNALSYM PFAX_ROUTING_METHODA}
  634.   _FAX_ROUTING_METHODA = record
  635.     SizeOfStruct: DWORD; // size of this structure
  636.     DeviceId: DWORD; // device identifier
  637.     Enabled: BOOL; // is this method enabled for this device?
  638.     DeviceName: LPCSTR; // device name
  639.     Guid: LPCSTR; // guid that identifies this routing method
  640.     FriendlyName: LPCSTR; // friendly name for this method
  641.     FunctionName: LPCSTR; // exported function name that identifies this method
  642.     ExtensionImageName: LPCSTR; // module (dll) name that implements this method
  643.     ExtensionFriendlyName: LPCSTR; // displayable string that identifies the extension
  644.   end;
  645.   {$EXTERNALSYM _FAX_ROUTING_METHODA}
  646.   FAX_ROUTING_METHODA = _FAX_ROUTING_METHODA;
  647.   {$EXTERNALSYM FAX_ROUTING_METHODA}
  648.   TFaxRoutingMethodA = FAX_ROUTING_METHODA;
  649.   PFaxRoutingMethodA = PFAX_ROUTING_METHODA;
  650.   PFAX_ROUTING_METHODW = ^FAX_ROUTING_METHODW;
  651.   {$EXTERNALSYM PFAX_ROUTING_METHODW}
  652.   _FAX_ROUTING_METHODW = record
  653.     SizeOfStruct: DWORD; // size of this structure
  654.     DeviceId: DWORD; // device identifier
  655.     Enabled: BOOL; // is this method enabled for this device?
  656.     DeviceName: LPCWSTR; // device name
  657.     Guid: LPCWSTR; // guid that identifies this routing method
  658.     FriendlyName: LPCWSTR; // friendly name for this method
  659.     FunctionName: LPCWSTR; // exported function name that identifies this method
  660.     ExtensionImageName: LPCWSTR; // module (dll) name that implements this method
  661.     ExtensionFriendlyName: LPCWSTR; // displayable string that identifies the extension
  662.   end;
  663.   {$EXTERNALSYM _FAX_ROUTING_METHODW}
  664.   FAX_ROUTING_METHODW = _FAX_ROUTING_METHODW;
  665.   {$EXTERNALSYM FAX_ROUTING_METHODW}
  666.   TFaxRoutingMethodW = FAX_ROUTING_METHODW;
  667.   PFaxRoutingMethodW = PFAX_ROUTING_METHODW;
  668. {$IFDEF UNICODE}
  669.   FAX_ROUTING_METHOD = FAX_ROUTING_METHODW;
  670.   {$EXTERNALSYM FAX_ROUTING_METHOD}
  671.   PFAX_ROUTING_METHOD = PFAX_ROUTING_METHODW;
  672.   {$EXTERNALSYM PFAX_ROUTING_METHOD}
  673.   TFaxRoutingMethod = TFaxRoutingMethodW;
  674.   PFaxRoutingMethod = PFaxRoutingMethodW;
  675. {$ELSE}
  676.   FAX_ROUTING_METHOD = FAX_ROUTING_METHODA;
  677.   {$EXTERNALSYM FAX_ROUTING_METHOD}
  678.   PFAX_ROUTING_METHOD = PFAX_ROUTING_METHODA;
  679.   {$EXTERNALSYM PFAX_ROUTING_METHOD}
  680.   TFaxRoutingMethod = TFaxRoutingMethodA;
  681.   PFaxRoutingMethod = PFaxRoutingMethodA;
  682. {$ENDIF}
  683.   PFAX_GLOBAL_ROUTING_INFOA = ^FAX_GLOBAL_ROUTING_INFOA;
  684.   {$EXTERNALSYM PFAX_GLOBAL_ROUTING_INFOA}
  685.   _FAX_GLOBAL_ROUTING_INFOA = record
  686.     SizeOfStruct: DWORD; // size of this structure
  687.     Priority: DWORD; // priority of this device
  688.     Guid: LPCSTR; // guid that identifies this routing method
  689.     FriendlyName: LPCSTR; // friendly name for this method
  690.     FunctionName: LPCSTR; // exported function name that identifies this method
  691.     ExtensionImageName: LPCSTR; // module (dll) name that implements this method
  692.     ExtensionFriendlyName: LPCSTR; // displayable string that identifies the extension
  693.   end;
  694.   {$EXTERNALSYM _FAX_GLOBAL_ROUTING_INFOA}
  695.   FAX_GLOBAL_ROUTING_INFOA = _FAX_GLOBAL_ROUTING_INFOA;
  696.   {$EXTERNALSYM FAX_GLOBAL_ROUTING_INFOA}
  697.   TFaxGlobalRoutingInfoA = FAX_GLOBAL_ROUTING_INFOA;
  698.   PFaxGlobalRoutingInfoA = PFAX_GLOBAL_ROUTING_INFOA;
  699.   PFAX_GLOBAL_ROUTING_INFOW = ^FAX_GLOBAL_ROUTING_INFOW;
  700.   {$EXTERNALSYM PFAX_GLOBAL_ROUTING_INFOW}
  701.   _FAX_GLOBAL_ROUTING_INFOW = record
  702.     SizeOfStruct: DWORD; // size of this structure
  703.     Priority: DWORD; // priority of this device
  704.     Guid: LPCWSTR; // guid that identifies this routing method
  705.     FriendlyName: LPCWSTR; // friendly name for this method
  706.     FunctionName: LPCWSTR; // exported function name that identifies this method
  707.     ExtensionImageName: LPCWSTR; // module (dll) name that implements this method
  708.     ExtensionFriendlyName: LPCWSTR; // displayable string that identifies the extension
  709.   end;
  710.   {$EXTERNALSYM _FAX_GLOBAL_ROUTING_INFOW}
  711.   FAX_GLOBAL_ROUTING_INFOW = _FAX_GLOBAL_ROUTING_INFOW;
  712.   {$EXTERNALSYM FAX_GLOBAL_ROUTING_INFOW}
  713.   TFaxGlobalRoutingInfoW = FAX_GLOBAL_ROUTING_INFOW;
  714.   PFaxGlobalRoutingInfoW = PFAX_GLOBAL_ROUTING_INFOW;
  715. {$IFDEF UNICODE}
  716.   FAX_GLOBAL_ROUTING_INFO = FAX_GLOBAL_ROUTING_INFOW;
  717.   {$EXTERNALSYM FAX_GLOBAL_ROUTING_INFO}
  718.   PFAX_GLOBAL_ROUTING_INFO = FAX_GLOBAL_ROUTING_INFOW;
  719.   {$EXTERNALSYM PFAX_GLOBAL_ROUTING_INFO}
  720.   TFaxGlobalRoutingInfo = TFaxGlobalRoutingInfoW;
  721.   PFaxGlobalRoutingInfo = PFaxGlobalRoutingInfoW;
  722. {$ELSE}
  723.   FAX_GLOBAL_ROUTING_INFO = FAX_GLOBAL_ROUTING_INFOA;
  724.   {$EXTERNALSYM FAX_GLOBAL_ROUTING_INFO}
  725.   PFAX_GLOBAL_ROUTING_INFO = FAX_GLOBAL_ROUTING_INFOA;
  726.   {$EXTERNALSYM PFAX_GLOBAL_ROUTING_INFO}
  727.   TFaxGlobalRoutingInfo = TFaxGlobalRoutingInfoA;
  728.   PFaxGlobalRoutingInfo = PFaxGlobalRoutingInfoA;
  729. {$ENDIF}
  730.   PFAX_COVERPAGE_INFOA = ^FAX_COVERPAGE_INFOA;
  731.   {$EXTERNALSYM PFAX_COVERPAGE_INFOA}
  732.   _FAX_COVERPAGE_INFOA = record
  733.     SizeOfStruct: DWORD; // Size of this structure
  734.     //
  735.     // general
  736.     //
  737.     CoverPageName: LPCSTR; // coverpage document name
  738.     UseServerCoverPage: BOOL; // coverpage exists on the fax server
  739.     //
  740.     // Recipient information
  741.     //
  742.     RecName: LPCSTR;
  743.     RecFaxNumber: LPCSTR;
  744.     RecCompany: LPCSTR;
  745.     RecStreetAddress: LPCSTR;
  746.     RecCity: LPCSTR;
  747.     RecState: LPCSTR;
  748.     RecZip: LPCSTR;
  749.     RecCountry: LPCSTR;
  750.     RecTitle: LPCSTR;
  751.     RecDepartment: LPCSTR;
  752.     RecOfficeLocation: LPCSTR;
  753.     RecHomePhone: LPCSTR;
  754.     RecOfficePhone: LPCSTR;
  755.     //
  756.     // Sender information
  757.     //
  758.     SdrName: LPCSTR;
  759.     SdrFaxNumber: LPCSTR;
  760.     SdrCompany: LPCSTR;
  761.     SdrAddress: LPCSTR;
  762.     SdrTitle: LPCSTR;
  763.     SdrDepartment: LPCSTR;
  764.     SdrOfficeLocation: LPCSTR;
  765.     SdrHomePhone: LPCSTR;
  766.     SdrOfficePhone: LPCSTR;
  767.     //
  768.     // Misc information
  769.     //
  770.     Note: LPCSTR;
  771.     Subject: LPCSTR;
  772.     TimeSent: SYSTEMTIME; // Time the fax was sent
  773.     PageCount: DWORD; // Number of pages
  774.   end;
  775.   {$EXTERNALSYM _FAX_COVERPAGE_INFOA}
  776.   FAX_COVERPAGE_INFOA = _FAX_COVERPAGE_INFOA;
  777.   {$EXTERNALSYM FAX_COVERPAGE_INFOA}
  778.   TFaxCoverpageInfoA = FAX_COVERPAGE_INFOA;
  779.   PFaxCoverpageInfoA = PFAX_COVERPAGE_INFOA;
  780.   PFAX_COVERPAGE_INFOW = ^FAX_COVERPAGE_INFOW;
  781.   {$EXTERNALSYM PFAX_COVERPAGE_INFOW}
  782.   _FAX_COVERPAGE_INFOW = record
  783.     SizeOfStruct: DWORD; // Size of this structure
  784.     //
  785.     // general
  786.     //
  787.     CoverPageName: LPCWSTR; // coverpage document name
  788.     UseServerCoverPage: BOOL; // coverpage exists on the fax server
  789.     //
  790.     // Recipient information
  791.     //
  792.     RecName: LPCWSTR;
  793.     RecFaxNumber: LPCWSTR;
  794.     RecCompany: LPCWSTR;
  795.     RecStreetAddress: LPCWSTR;
  796.     RecCity: LPCWSTR;
  797.     RecState: LPCWSTR;
  798.     RecZip: LPCWSTR;
  799.     RecCountry: LPCWSTR;
  800.     RecTitle: LPCWSTR;
  801.     RecDepartment: LPCWSTR;
  802.     RecOfficeLocation: LPCWSTR;
  803.     RecHomePhone: LPCWSTR;
  804.     RecOfficePhone: LPCWSTR;
  805.     //
  806.     // Sender information
  807.     //
  808.     SdrName: LPCWSTR;
  809.     SdrFaxNumber: LPCWSTR;
  810.     SdrCompany: LPCWSTR;
  811.     SdrAddress: LPCWSTR;
  812.     SdrTitle: LPCWSTR;
  813.     SdrDepartment: LPCWSTR;
  814.     SdrOfficeLocation: LPCWSTR;
  815.     SdrHomePhone: LPCWSTR;
  816.     SdrOfficePhone: LPCWSTR;
  817.     //
  818.     // Misc information
  819.     //
  820.     Note: LPCWSTR;
  821.     Subject: LPCWSTR;
  822.     TimeSent: SYSTEMTIME; // Time the fax was sent
  823.     PageCount: DWORD; // Number of pages
  824.   end;
  825.   {$EXTERNALSYM _FAX_COVERPAGE_INFOW}
  826.   FAX_COVERPAGE_INFOW = _FAX_COVERPAGE_INFOW;
  827.   {$EXTERNALSYM FAX_COVERPAGE_INFOW}
  828.   TFaxCoverpageInfoW = FAX_COVERPAGE_INFOW;
  829.   PFaxCoverpageInfoW = PFAX_COVERPAGE_INFOW;
  830. {$IFDEF UNICODE}
  831.   FAX_COVERPAGE_INFO = FAX_COVERPAGE_INFOW;
  832.   {$EXTERNALSYM FAX_COVERPAGE_INFO}
  833.   PFAX_COVERPAGE_INFO = PFAX_COVERPAGE_INFOW;
  834.   {$EXTERNALSYM PFAX_COVERPAGE_INFO}
  835.   TFaxCoverpageInfo = TFaxCoverpageInfoW;
  836.   PFaxCoverpageInfo = PFaxCoverpageInfoW;
  837. {$ELSE}
  838.   FAX_COVERPAGE_INFO = FAX_COVERPAGE_INFOA;
  839.   {$EXTERNALSYM FAX_COVERPAGE_INFO}
  840.   PFAX_COVERPAGE_INFO = PFAX_COVERPAGE_INFOA;
  841.   {$EXTERNALSYM PFAX_COVERPAGE_INFO}
  842.   TFaxCoverpageInfo = TFaxCoverpageInfoA;
  843.   PFaxCoverpageInfo = PFaxCoverpageInfoA;
  844. {$ENDIF}
  845.   FAX_ENUM_JOB_SEND_ATTRIBUTES = (
  846.     JSA_NOW,                        // Send now
  847.     JSA_SPECIFIC_TIME,              // Send at specific time
  848.     JSA_DISCOUNT_PERIOD);           // Send at server configured discount period
  849.   {$EXTERNALSYM FAX_ENUM_JOB_SEND_ATTRIBUTES}
  850.   TFaxEnumJobSendAttributes = FAX_ENUM_JOB_SEND_ATTRIBUTES;
  851.   FAX_ENUM_DELIVERY_REPORT_TYPES = (
  852.     DRT_NONE,          // Do not send receipt
  853.     DRT_EMAIL,         // Send receipt by email
  854.     DRT_INBOX);        // send receipt to local inbox
  855.   {$EXTERNALSYM FAX_ENUM_DELIVERY_REPORT_TYPES}
  856.   TFaxEnumDeliveryReportTypes = FAX_ENUM_DELIVERY_REPORT_TYPES;
  857.   HCALL = HANDLE; // todo from TAPI
  858.   PFAX_JOB_PARAMA = ^FAX_JOB_PARAMA;
  859.   {$EXTERNALSYM PFAX_JOB_PARAMA}
  860.   _FAX_JOB_PARAMA = record
  861.     SizeOfStruct: DWORD; // size of this structure
  862.     RecipientNumber: LPCSTR; // recipient fax number
  863.     RecipientName: LPCSTR; // recipient name
  864.     Tsid: LPCSTR; // transmitter's id
  865.     SenderName: LPCSTR; // sender name
  866.     SenderCompany: LPCSTR; // sender company
  867.     SenderDept: LPCSTR; // sender department
  868.     BillingCode: LPCSTR; // billing code
  869.     ScheduleAction: DWORD; // when to schedule the fax, see JSA defines
  870.     ScheduleTime: SYSTEMTIME; // time to send the fax when JSA_SPECIFIC_TIME is used (must be local time)
  871.     DeliveryReportType: DWORD; // delivery report type, see DRT defines
  872.     DeliveryReportAddress: LPCSTR; // email address for delivery report (ndr or dr) thru MAPI / SMTP
  873.     DocumentName: LPCSTR; // document name (optional)
  874.     CallHandle: HCALL; // optional call handle
  875.     Reserved: array [0..3 - 1] of DWORD_PTR; // reserved for ms use only
  876.   end;
  877.   {$EXTERNALSYM _FAX_JOB_PARAMA}
  878.   FAX_JOB_PARAMA = _FAX_JOB_PARAMA;
  879.   {$EXTERNALSYM FAX_JOB_PARAMA}
  880.   TFaxJobParamA = FAX_JOB_PARAMA;
  881.   PFaxJobParamA = PFAX_JOB_PARAMA;
  882.   PFAX_JOB_PARAMW = ^FAX_JOB_PARAMW;
  883.   {$EXTERNALSYM PFAX_JOB_PARAMW}
  884.   _FAX_JOB_PARAMW = record
  885.     SizeOfStruct: DWORD; // size of this structure
  886.     RecipientNumber: LPCWSTR; // recipient fax number
  887.     RecipientName: LPCWSTR; // recipient name
  888.     Tsid: LPCWSTR; // transmitter's id
  889.     SenderName: LPCWSTR; // sender name
  890.     SenderCompany: LPCWSTR; // sender company
  891.     SenderDept: LPCWSTR; // sender department
  892.     BillingCode: LPCWSTR; // billing code
  893.     ScheduleAction: DWORD; // when to schedule the fax, see JSA defines
  894.     ScheduleTime: SYSTEMTIME; // time to send the fax when JSA_SPECIFIC_TIME is used (must be local time)
  895.     DeliveryReportType: DWORD; // delivery report type, see DRT defines
  896.     DeliveryReportAddress: LPCWSTR; // email address for delivery report (ndr or dr) thru MAPI / SMTP
  897.     DocumentName: LPCWSTR; // document name (optional)
  898.     CallHandle: HCALL; // optional call handle
  899.     Reserved: array [0..3 - 1] of DWORD_PTR; // reserved for ms use only
  900.   end;
  901.   {$EXTERNALSYM _FAX_JOB_PARAMW}
  902.   FAX_JOB_PARAMW = _FAX_JOB_PARAMW;
  903.   {$EXTERNALSYM FAX_JOB_PARAMW}
  904.   TFaxJobParamW = FAX_JOB_PARAMW;
  905.   PFaxJobParamW = PFAX_JOB_PARAMW;
  906. {$IFDEF UNICODE}
  907.   FAX_JOB_PARAM = FAX_JOB_PARAMW;
  908.   {$EXTERNALSYM FAX_JOB_PARAM}
  909.   PFAX_JOB_PARAM = PFAX_JOB_PARAMW;
  910.   {$EXTERNALSYM PFAX_JOB_PARAM}
  911.   TFaxJobParam = TFaxJobParamW;
  912.   PFaxJobParam = PFaxJobParamW;
  913. {$ELSE}
  914.   FAX_JOB_PARAM = FAX_JOB_PARAMA;
  915.   {$EXTERNALSYM FAX_JOB_PARAM}
  916.   PFAX_JOB_PARAM = PFAX_JOB_PARAMA;
  917.   {$EXTERNALSYM PFAX_JOB_PARAM}
  918.   TFaxJobParam = TFaxJobParamA;
  919.   PFaxJobParam = PFaxJobParamA;
  920. {$ENDIF}
  921. //
  922. // Event Ids
  923. //
  924. // FEI_NEVENTS is the number of events
  925. //
  926. const
  927.   FEI_DIALING           = $00000001;
  928.   {$EXTERNALSYM FEI_DIALING}
  929.   FEI_SENDING           = $00000002;
  930.   {$EXTERNALSYM FEI_SENDING}
  931.   FEI_RECEIVING         = $00000003;
  932.   {$EXTERNALSYM FEI_RECEIVING}
  933.   FEI_COMPLETED         = $00000004;
  934.   {$EXTERNALSYM FEI_COMPLETED}
  935.   FEI_BUSY              = $00000005;
  936.   {$EXTERNALSYM FEI_BUSY}
  937.   FEI_NO_ANSWER         = $00000006;
  938.   {$EXTERNALSYM FEI_NO_ANSWER}
  939.   FEI_BAD_ADDRESS       = $00000007;
  940.   {$EXTERNALSYM FEI_BAD_ADDRESS}
  941.   FEI_NO_DIAL_TONE      = $00000008;
  942.   {$EXTERNALSYM FEI_NO_DIAL_TONE}
  943.   FEI_DISCONNECTED      = $00000009;
  944.   {$EXTERNALSYM FEI_DISCONNECTED}
  945.   FEI_FATAL_ERROR       = $0000000a;
  946.   {$EXTERNALSYM FEI_FATAL_ERROR}
  947.   FEI_NOT_FAX_CALL      = $0000000b;
  948.   {$EXTERNALSYM FEI_NOT_FAX_CALL}
  949.   FEI_CALL_DELAYED      = $0000000c;
  950.   {$EXTERNALSYM FEI_CALL_DELAYED}
  951.   FEI_CALL_BLACKLISTED  = $0000000d;
  952.   {$EXTERNALSYM FEI_CALL_BLACKLISTED}
  953.   FEI_RINGING           = $0000000e;
  954.   {$EXTERNALSYM FEI_RINGING}
  955.   FEI_ABORTING          = $0000000f;
  956.   {$EXTERNALSYM FEI_ABORTING}
  957.   FEI_ROUTING           = $00000010;
  958.   {$EXTERNALSYM FEI_ROUTING}
  959.   FEI_MODEM_POWERED_ON  = $00000011;
  960.   {$EXTERNALSYM FEI_MODEM_POWERED_ON}
  961.   FEI_MODEM_POWERED_OFF = $00000012;
  962.   {$EXTERNALSYM FEI_MODEM_POWERED_OFF}
  963.   FEI_IDLE              = $00000013;
  964.   {$EXTERNALSYM FEI_IDLE}
  965.   FEI_FAXSVC_ENDED      = $00000014;
  966.   {$EXTERNALSYM FEI_FAXSVC_ENDED}
  967.   FEI_ANSWERED          = $00000015;
  968.   {$EXTERNALSYM FEI_ANSWERED}
  969.   FEI_JOB_QUEUED        = $00000016;
  970.   {$EXTERNALSYM FEI_JOB_QUEUED}
  971.   FEI_DELETED           = $00000017;
  972.   {$EXTERNALSYM FEI_DELETED}
  973.   FEI_INITIALIZING      = $00000018;
  974.   {$EXTERNALSYM FEI_INITIALIZING}
  975.   FEI_LINE_UNAVAILABLE  = $00000019;
  976.   {$EXTERNALSYM FEI_LINE_UNAVAILABLE}
  977.   FEI_HANDLED           = $0000001a;
  978.   {$EXTERNALSYM FEI_HANDLED}
  979.   FEI_FAXSVC_STARTED    = $0000001b;
  980.   {$EXTERNALSYM FEI_FAXSVC_STARTED}
  981.   FEI_NEVENTS = FEI_FAXSVC_STARTED;
  982.   {$EXTERNALSYM FEI_NEVENTS}
  983. type
  984.   PFAX_EVENTA = ^FAX_EVENTA;
  985.   {$EXTERNALSYM PFAX_EVENTA}
  986.   _FAX_EVENTA = record
  987.     SizeOfStruct: DWORD; // Size of this structure
  988.     TimeStamp: FILETIME; // Timestamp for when the event was generated
  989.     DeviceId: DWORD; // Permanent line id
  990.     EventId: DWORD; // Current event id
  991.     JobId: DWORD; // Fax Job Id, 0xffffffff indicates inactive job
  992.   end;
  993.   {$EXTERNALSYM _FAX_EVENTA}
  994.   FAX_EVENTA = _FAX_EVENTA;
  995.   {$EXTERNALSYM FAX_EVENTA}
  996.   TFaxEventA = FAX_EVENTA;
  997.   PFaxEventA = PFAX_EVENTA;
  998.   PFAX_EVENTW = ^FAX_EVENTW;
  999.   {$EXTERNALSYM PFAX_EVENTW}
  1000.   _FAX_EVENTW = record
  1001.     SizeOfStruct: DWORD; // Size of this structure
  1002.     TimeStamp: FILETIME; // Timestamp for when the event was generated
  1003.     DeviceId: DWORD; // Permanent line id
  1004.     EventId: DWORD; // Current event id
  1005.     JobId: DWORD; // Fax Job Id, 0xffffffff indicates inactive job
  1006.   end;
  1007.   {$EXTERNALSYM _FAX_EVENTW}
  1008.   FAX_EVENTW = _FAX_EVENTW;
  1009.   {$EXTERNALSYM FAX_EVENTW}
  1010.   TFaxEventW = FAX_EVENTW;
  1011.   PFaxEventW = PFAX_EVENTW;
  1012. {$IFDEF UNICODE}
  1013.   FAX_EVENT = FAX_EVENTW;
  1014.   {$EXTERNALSYM FAX_EVENT}
  1015.   PFAX_EVENT = PFAX_EVENTW;
  1016.   {$EXTERNALSYM PFAX_EVENT}
  1017.   TFaxEvent = TFaxEventW;
  1018.   PFaxEvent = PFaxEventW;
  1019. {$ELSE}
  1020.   FAX_EVENT = FAX_EVENTA;
  1021.   {$EXTERNALSYM FAX_EVENT}
  1022.   PFAX_EVENT = PFAX_EVENTA;
  1023.   {$EXTERNALSYM PFAX_EVENT}
  1024.   TFaxEvent = TFaxEventA;
  1025.   PFaxEvent = PFaxEventA;
  1026. {$ENDIF}
  1027.   PFAX_PRINT_INFOA = ^FAX_PRINT_INFOA;
  1028.   {$EXTERNALSYM PFAX_PRINT_INFOA}
  1029.   _FAX_PRINT_INFOA = record
  1030.     SizeOfStruct: DWORD; // Size of this structure
  1031.     DocName: LPCSTR; // Document name that appears in the spooler
  1032.     RecipientName: LPCSTR; // Recipient name
  1033.     RecipientNumber: LPCSTR; // Recipient fax number (non-canonical number)
  1034.     SenderName: LPCSTR; // Sender name
  1035.     SenderCompany: LPCSTR; // Sender company (optional)
  1036.     SenderDept: LPCSTR; // Sender department
  1037.     SenderBillingCode: LPCSTR; // Billing code
  1038.     Reserved: LPCSTR; // Reserved; must be NULL
  1039.     DrEmailAddress: LPCSTR; // E.Mail address for delivery report
  1040.     OutputFileName: LPCSTR; // for print to file, resulting file name
  1041.   end;
  1042.   {$EXTERNALSYM _FAX_PRINT_INFOA}
  1043.   FAX_PRINT_INFOA = _FAX_PRINT_INFOA;
  1044.   {$EXTERNALSYM FAX_PRINT_INFOA}
  1045.   TFaxPrintInfoA = FAX_PRINT_INFOA;
  1046.   PFaxPrintInfoA = PFAX_PRINT_INFOA;
  1047.   PFAX_PRINT_INFOW = ^FAX_PRINT_INFOW;
  1048.   {$EXTERNALSYM PFAX_PRINT_INFOW}
  1049.   _FAX_PRINT_INFOW = record
  1050.     SizeOfStruct: DWORD; // Size of this structure
  1051.     DocName: LPCWSTR; // Document name that appears in the spooler
  1052.     RecipientName: LPCWSTR; // Recipient name
  1053.     RecipientNumber: LPCWSTR; // Recipient fax number (non-canonical number)
  1054.     SenderName: LPCWSTR; // Sender name
  1055.     SenderCompany: LPCWSTR; // Sender company (optional)
  1056.     SenderDept: LPCWSTR; // Sender department
  1057.     SenderBillingCode: LPCWSTR; // Billing code
  1058.     Reserved: LPCWSTR; // Reserved; must be NULL
  1059.     DrEmailAddress: LPCWSTR; // E.Mail address for delivery report
  1060.     OutputFileName: LPCWSTR; // for print to file, resulting file name
  1061.   end;
  1062.   {$EXTERNALSYM _FAX_PRINT_INFOW}
  1063.   FAX_PRINT_INFOW = _FAX_PRINT_INFOW;
  1064.   {$EXTERNALSYM FAX_PRINT_INFOW}
  1065.   TFaxPrintInfoW = FAX_PRINT_INFOW;
  1066.   PFaxPrintInfoW = PFAX_PRINT_INFOW;
  1067. {$IFDEF UNICODE}
  1068.   FAX_PRINT_INFO = FAX_PRINT_INFOW;
  1069.   {$EXTERNALSYM FAX_PRINT_INFO}
  1070.   PFAX_PRINT_INFO = PFAX_PRINT_INFOW;
  1071.   {$EXTERNALSYM PFAX_PRINT_INFO}
  1072.   TFaxPrintInfo = TFaxPrintInfoW;
  1073.   PFaxPrintInfo = PFaxPrintInfoW;
  1074. {$ELSE}
  1075.   FAX_PRINT_INFO = FAX_PRINT_INFOA;
  1076.   {$EXTERNALSYM FAX_PRINT_INFO}
  1077.   PFAX_PRINT_INFO = PFAX_PRINT_INFOA;
  1078.   {$EXTERNALSYM PFAX_PRINT_INFO}
  1079.   TFaxPrintInfo = TFaxPrintInfoA;
  1080.   PFaxPrintInfo = PFaxPrintInfoA;
  1081. {$ENDIF}
  1082.   PFAX_CONTEXT_INFOA = ^FAX_CONTEXT_INFOA;
  1083.   {$EXTERNALSYM PFAX_CONTEXT_INFOA}
  1084.   _FAX_CONTEXT_INFOA = record
  1085.     SizeOfStruct: DWORD; // Size of this structure
  1086.     hDC: HDC; // Device Context
  1087.     ServerName: array [0..MAX_COMPUTERNAME_LENGTH] of CHAR; // Server name
  1088.   end;
  1089.   {$EXTERNALSYM _FAX_CONTEXT_INFOA}
  1090.   FAX_CONTEXT_INFOA = _FAX_CONTEXT_INFOA;
  1091.   {$EXTERNALSYM FAX_CONTEXT_INFOA}
  1092.   TFaxContextInfoA = FAX_CONTEXT_INFOA;
  1093.   PFaxContextInfoA = PFAX_CONTEXT_INFOA;
  1094.   PFAX_CONTEXT_INFOW = ^FAX_CONTEXT_INFOW;
  1095.   {$EXTERNALSYM PFAX_CONTEXT_INFOW}
  1096.   _FAX_CONTEXT_INFOW = record
  1097.     SizeOfStruct: DWORD; // Size of this structure
  1098.     hDC: HDC; // Device Context
  1099.     ServerName: array [0..MAX_COMPUTERNAME_LENGTH] of WCHAR; // Server name
  1100.   end;
  1101.   {$EXTERNALSYM _FAX_CONTEXT_INFOW}
  1102.   FAX_CONTEXT_INFOW = _FAX_CONTEXT_INFOW;
  1103.   {$EXTERNALSYM FAX_CONTEXT_INFOW}
  1104.   TFaxContextInfoW = FAX_CONTEXT_INFOW;
  1105.   PFaxContextInfoW = PFAX_CONTEXT_INFOW;
  1106. {$IFDEF UNICODE}
  1107.   FAX_CONTEXT_INFO = FAX_CONTEXT_INFOW;
  1108.   {$EXTERNALSYM FAX_CONTEXT_INFO}
  1109.   PFAX_CONTEXT_INFO = PFAX_CONTEXT_INFOW;
  1110.   {$EXTERNALSYM PFAX_CONTEXT_INFO}
  1111.   TFaxContextInfo = TFaxContextInfoW;
  1112.   PFaxContextInfo = PFaxContextInfoW;  
  1113. {$ELSE}
  1114.   FAX_CONTEXT_INFO = FAX_CONTEXT_INFOA;
  1115.   {$EXTERNALSYM FAX_CONTEXT_INFO}
  1116.   PFAX_CONTEXT_INFO = PFAX_CONTEXT_INFOA;
  1117.   {$EXTERNALSYM PFAX_CONTEXT_INFO}
  1118.   TFaxContextInfo = TFaxContextInfoA;
  1119.   PFaxContextInfo = PFaxContextInfoA;
  1120. {$ENDIF}
  1121. //
  1122. // prototypes
  1123. //
  1124. function FaxConnectFaxServerA(MachineName: LPCSTR; var FaxHandle: HANDLE): BOOL; stdcall;
  1125. {$EXTERNALSYM FaxConnectFaxServerA}
  1126. function FaxConnectFaxServerW(MachineName: LPCWSTR; var FaxHandle: HANDLE): BOOL; stdcall;
  1127. {$EXTERNALSYM FaxConnectFaxServerW}
  1128. {$IFDEF UNICODE}
  1129. function FaxConnectFaxServer(MachineName: LPCWSTR; var FaxHandle: HANDLE): BOOL; stdcall;
  1130. {$EXTERNALSYM FaxConnectFaxServer}
  1131. {$ELSE}
  1132. function FaxConnectFaxServer(MachineName: LPCSTR; var FaxHandle: HANDLE): BOOL; stdcall;
  1133. {$EXTERNALSYM FaxConnectFaxServer}
  1134. {$ENDIF}
  1135. function FaxClose(FaxHandle: HANDLE): BOOL; stdcall;
  1136. {$EXTERNALSYM FaxClose}
  1137. type
  1138.   FAX_ENUM_PORT_OPEN_TYPE = (
  1139.     PORT_OPEN_FILLER0,
  1140.     PORT_OPEN_QUERY,
  1141.     PORT_OPEN_MODIFY);
  1142.   {$EXTERNALSYM FAX_ENUM_PORT_OPEN_TYPE}
  1143.   TFaxEnumPortOpenType = FAX_ENUM_PORT_OPEN_TYPE;
  1144. function FaxOpenPort(FaxHandle: HANDLE; DeviceId: DWORD; Flags: DWORD; var FaxPortHandle: HANDLE): BOOL; stdcall;
  1145. {$EXTERNALSYM FaxOpenPort}
  1146. function FaxCompleteJobParamsA(var JobParams: PFAX_JOB_PARAMA; var CoverpageInfo: PFAX_COVERPAGE_INFOA): BOOL; stdcall;
  1147. {$EXTERNALSYM FaxCompleteJobParamsA}
  1148. function FaxCompleteJobParamsW(var JobParams: PFAX_JOB_PARAMW; var CoverpageInfo: PFAX_COVERPAGE_INFOW): BOOL; stdcall;
  1149. {$EXTERNALSYM FaxCompleteJobParamsW}
  1150. {$IFDEF UNICODE}
  1151. function FaxCompleteJobParams(var JobParams: PFAX_JOB_PARAMW; var CoverpageInfo: PFAX_COVERPAGE_INFOW): BOOL; stdcall;
  1152. {$EXTERNALSYM FaxCompleteJobParams}
  1153. {$ELSE}
  1154. function FaxCompleteJobParams(var JobParams: PFAX_JOB_PARAMA; var CoverpageInfo: PFAX_COVERPAGE_INFOA): BOOL; stdcall;
  1155. {$EXTERNALSYM FaxCompleteJobParams}
  1156. {$ENDIF}
  1157. function FaxSendDocumentA(FaxHandle: HANDLE; FileName: LPCSTR; JobParams: PFAX_JOB_PARAMA; CoverpageInfo: PFAX_COVERPAGE_INFOA; FaxJobId: LPDWORD): BOOL; stdcall;
  1158. {$EXTERNALSYM FaxSendDocumentA}
  1159. function FaxSendDocumentW(FaxHandle: HANDLE; FileName: LPCWSTR; JobParams: PFAX_JOB_PARAMW; CoverpageInfo: PFAX_COVERPAGE_INFOW; FaxJobId: LPDWORD): BOOL; stdcall;
  1160. {$EXTERNALSYM FaxSendDocumentW}
  1161. {$IFDEF UNICODE}
  1162. function FaxSendDocument(FaxHandle: HANDLE; FileName: LPCWSTR; JobParams: PFAX_JOB_PARAMW; CoverpageInfo: PFAX_COVERPAGE_INFOW; FaxJobId: LPDWORD): BOOL; stdcall;
  1163. {$EXTERNALSYM FaxSendDocument}
  1164. {$ELSE}
  1165. function FaxSendDocument(FaxHandle: HANDLE; FileName: LPCSTR; JobParams: PFAX_JOB_PARAMA; CoverpageInfo: PFAX_COVERPAGE_INFOA; FaxJobId: LPDWORD): BOOL; stdcall;
  1166. {$EXTERNALSYM FaxSendDocument}
  1167. {$ENDIF}
  1168. type
  1169.   PFAX_RECIPIENT_CALLBACKA = function (FaxHandle: HANDLE; RecipientNumber: DWORD; Context: LPVOID; JobParams: PFAX_JOB_PARAMA; CoverpageInfo: PFAX_COVERPAGE_INFOA): BOOL; stdcall;
  1170.   {$EXTERNALSYM PFAX_RECIPIENT_CALLBACKA}
  1171.   TFaxRecipientCallbackA = PFAX_RECIPIENT_CALLBACKA;
  1172.   PFAX_RECIPIENT_CALLBACKW = function (FaxHandle: HANDLE; RecipientNumber: DWORD; Context: LPVOID; JobParams: PFAX_JOB_PARAMW; CoverpageInfo: PFAX_COVERPAGE_INFOW): BOOL; stdcall;
  1173.   {$EXTERNALSYM PFAX_RECIPIENT_CALLBACKW}
  1174.   TFaxRecipientCallbackW = PFAX_RECIPIENT_CALLBACKW;
  1175. {$IFDEF UNICODE}
  1176.   PFAX_RECIPIENT_CALLBACK = PFAX_RECIPIENT_CALLBACKW;
  1177.   {$EXTERNALSYM PFAX_RECIPIENT_CALLBACK}
  1178.   TFaxRecipientCallback = TFaxRecipientCallbackW;
  1179. {$ELSE}
  1180.   PFAX_RECIPIENT_CALLBACK = PFAX_RECIPIENT_CALLBACKA;
  1181.   {$EXTERNALSYM PFAX_RECIPIENT_CALLBACK}
  1182.   TFaxRecipientCallback = TFaxRecipientCallbackA;  
  1183. {$ENDIF}
  1184. function FaxSendDocumentForBroadcastA(FaxHandle: HANDLE; FileName: LPCSTR; FaxJobId: LPDWORD; FaxRecipientCallback: PFAX_RECIPIENT_CALLBACKA; Context: LPVOID): BOOL; stdcall;
  1185. {$EXTERNALSYM FaxSendDocumentForBroadcastA}
  1186. function FaxSendDocumentForBroadcastW(FaxHandle: HANDLE; FileName: LPCWSTR; FaxJobId: LPDWORD; FaxRecipientCallback: PFAX_RECIPIENT_CALLBACKW; Context: LPVOID): BOOL; stdcall;
  1187. {$EXTERNALSYM FaxSendDocumentForBroadcastW}
  1188. {$IFDEF UNICODE}
  1189. function FaxSendDocumentForBroadcast(FaxHandle: HANDLE; FileName: LPCWSTR; FaxJobId: LPDWORD; FaxRecipientCallback: PFAX_RECIPIENT_CALLBACKW; Context: LPVOID): BOOL; stdcall;
  1190. {$EXTERNALSYM FaxSendDocumentForBroadcast}
  1191. {$ELSE}
  1192. function FaxSendDocumentForBroadcast(FaxHandle: HANDLE; FileName: LPCSTR; FaxJobId: LPDWORD; FaxRecipientCallback: PFAX_RECIPIENT_CALLBACKA; Context: LPVOID): BOOL; stdcall;
  1193. {$EXTERNALSYM FaxSendDocumentForBroadcast}
  1194. {$ENDIF}
  1195. function FaxEnumJobsA(FaxHandle: HANDLE; var JobEntry: PFAX_JOB_ENTRYA; var JobsReturned: DWORD): BOOL; stdcall;
  1196. {$EXTERNALSYM FaxEnumJobsA}
  1197. function FaxEnumJobsW(FaxHandle: HANDLE; var JobEntry: PFAX_JOB_ENTRYW; var JobsReturned: DWORD): BOOL; stdcall;
  1198. {$EXTERNALSYM FaxEnumJobsW}
  1199. {$IFDEF UNICODE}
  1200. function FaxEnumJobs(FaxHandle: HANDLE; var JobEntry: PFAX_JOB_ENTRYW; var JobsReturned: DWORD): BOOL; stdcall;
  1201. {$EXTERNALSYM FaxEnumJobs}
  1202. {$ELSE}
  1203. function FaxEnumJobs(FaxHandle: HANDLE; var JobEntry: PFAX_JOB_ENTRYA; var JobsReturned: DWORD): BOOL; stdcall;
  1204. {$EXTERNALSYM FaxEnumJobs}
  1205. {$ENDIF}
  1206. function FaxGetJobA(FaxHandle: HANDLE; JobId: DWORD; var JobEntry: PFAX_JOB_ENTRYA): BOOL; stdcall;
  1207. {$EXTERNALSYM FaxGetJobA}
  1208. function FaxGetJobW(FaxHandle: HANDLE; JobId: DWORD; var JobEntry: PFAX_JOB_ENTRYW): BOOL; stdcall;
  1209. {$EXTERNALSYM FaxGetJobW}
  1210. {$IFDEF UNICODE}
  1211. function FaxGetJob(FaxHandle: HANDLE; JobId: DWORD; var JobEntry: PFAX_JOB_ENTRYW): BOOL; stdcall;
  1212. {$EXTERNALSYM FaxGetJob}
  1213. {$ELSE}
  1214. function FaxGetJob(FaxHandle: HANDLE; JobId: DWORD; var JobEntry: PFAX_JOB_ENTRYA): BOOL; stdcall;
  1215. {$EXTERNALSYM FaxGetJob}
  1216. {$ENDIF}
  1217. function FaxSetJobA(FaxHandle: HANDLE; JobId: DWORD; Command: DWORD; JobEntry: PFAX_JOB_ENTRYA): BOOL; stdcall;
  1218. {$EXTERNALSYM FaxSetJobA}
  1219. function FaxSetJobW(FaxHandle: HANDLE; JobId: DWORD; Command: DWORD; JobEntry: PFAX_JOB_ENTRYW): BOOL; stdcall;
  1220. {$EXTERNALSYM FaxSetJobW}
  1221. {$IFDEF UNICODE}
  1222. function FaxSetJob(FaxHandle: HANDLE; JobId: DWORD; Command: DWORD; JobEntry: PFAX_JOB_ENTRYW): BOOL; stdcall;
  1223. {$EXTERNALSYM FaxSetJob}
  1224. {$ELSE}
  1225. function FaxSetJob(FaxHandle: HANDLE; JobId: DWORD; Command: DWORD; JobEntry: PFAX_JOB_ENTRYA): BOOL; stdcall;
  1226. {$EXTERNALSYM FaxSetJob}
  1227. {$ENDIF}
  1228. function FaxGetPageData(FaxHandle: HANDLE; JobId: DWORD; var Buffer: LPBYTE; var BufferSize, ImageWidth, ImageHeight: DWORD): BOOL; stdcall;
  1229. {$EXTERNALSYM FaxGetPageData}
  1230. function FaxGetDeviceStatusA(FaxPortHandle: HANDLE; var DeviceStatus: PFAX_DEVICE_STATUSA): BOOL; stdcall;
  1231. {$EXTERNALSYM FaxGetDeviceStatusA}
  1232. function FaxGetDeviceStatusW(FaxPortHandle: HANDLE; var DeviceStatus: PFAX_DEVICE_STATUSW): BOOL; stdcall;
  1233. {$EXTERNALSYM FaxGetDeviceStatusW}
  1234. {$IFDEF UNICODE}
  1235. function FaxGetDeviceStatus(FaxPortHandle: HANDLE; var DeviceStatus: PFAX_DEVICE_STATUSW): BOOL; stdcall;
  1236. {$EXTERNALSYM FaxGetDeviceStatus}
  1237. {$ELSE}
  1238. function FaxGetDeviceStatus(FaxPortHandle: HANDLE; var DeviceStatus: PFAX_DEVICE_STATUSA): BOOL; stdcall;
  1239. {$EXTERNALSYM FaxGetDeviceStatus}
  1240. {$ENDIF}
  1241. function FaxAbort(FaxHandle: HANDLE; JobId: DWORD): BOOL; stdcall;
  1242. {$EXTERNALSYM FaxAbort}
  1243. function FaxGetConfigurationA(FaxHandle: HANDLE; var FaxConfig: PFAX_CONFIGURATIONA): BOOL; stdcall;
  1244. {$EXTERNALSYM FaxGetConfigurationA}
  1245. function FaxGetConfigurationW(FaxHandle: HANDLE; var FaxConfig: PFAX_CONFIGURATIONW): BOOL; stdcall;
  1246. {$EXTERNALSYM FaxGetConfigurationW}
  1247. {$IFDEF UNICODE}
  1248. function FaxGetConfiguration(FaxHandle: HANDLE; var FaxConfig: PFAX_CONFIGURATIONW): BOOL; stdcall;
  1249. {$EXTERNALSYM FaxGetConfiguration}
  1250. {$ELSE}
  1251. function FaxGetConfiguration(FaxHandle: HANDLE; var FaxConfig: PFAX_CONFIGURATIONA): BOOL; stdcall;
  1252. {$EXTERNALSYM FaxGetConfiguration}
  1253. {$ENDIF}
  1254. function FaxSetConfigurationA(FaxHandle: HANDLE; const FaxConfig: FAX_CONFIGURATIONA): BOOL; stdcall;
  1255. {$EXTERNALSYM FaxSetConfigurationA}
  1256. function FaxSetConfigurationW(FaxHandle: HANDLE; const FaxConfig: FAX_CONFIGURATIONW): BOOL; stdcall;
  1257. {$EXTERNALSYM FaxSetConfigurationW}
  1258. {$IFDEF UNICODE}
  1259. function FaxSetConfiguration(FaxHandle: HANDLE; const FaxConfig: FAX_CONFIGURATIONW): BOOL; stdcall;
  1260. {$EXTERNALSYM FaxSetConfiguration}
  1261. {$ELSE}
  1262. function FaxSetConfiguration(FaxHandle: HANDLE; const FaxConfig: FAX_CONFIGURATIONA): BOOL; stdcall;
  1263. {$EXTERNALSYM FaxSetConfiguration}
  1264. {$ENDIF}
  1265. function FaxGetLoggingCategoriesA(FaxHandle: HANDLE; var Categories: PFAX_LOG_CATEGORYA; var NumberCategories: DWORD): BOOL; stdcall;
  1266. {$EXTERNALSYM FaxGetLoggingCategoriesA}
  1267. function FaxGetLoggingCategoriesW(FaxHandle: HANDLE; var Categories: PFAX_LOG_CATEGORYW; var NumberCategories: DWORD): BOOL; stdcall;
  1268. {$EXTERNALSYM FaxGetLoggingCategoriesW}
  1269. {$IFDEF UNICODE}
  1270. function FaxGetLoggingCategories(FaxHandle: HANDLE; var Categories: PFAX_LOG_CATEGORYW; var NumberCategories: DWORD): BOOL; stdcall;
  1271. {$EXTERNALSYM FaxGetLoggingCategories}
  1272. {$ELSE}
  1273. function FaxGetLoggingCategories(FaxHandle: HANDLE; var Categories: PFAX_LOG_CATEGORYA; var NumberCategories: DWORD): BOOL; stdcall;
  1274. {$EXTERNALSYM FaxGetLoggingCategories}
  1275. {$ENDIF}
  1276. function FaxSetLoggingCategoriesA(FaxHandle: HANDLE; Categories: PFAX_LOG_CATEGORYA; NumberCategories: DWORD): BOOL; stdcall;
  1277. {$EXTERNALSYM FaxSetLoggingCategoriesA}
  1278. function FaxSetLoggingCategoriesW(FaxHandle: HANDLE; Categories: PFAX_LOG_CATEGORYW; NumberCategories: DWORD): BOOL; stdcall;
  1279. {$EXTERNALSYM FaxSetLoggingCategoriesW}
  1280. {$IFDEF UNICODE}
  1281. function FaxSetLoggingCategories(FaxHandle: HANDLE; Categories: PFAX_LOG_CATEGORYW; NumberCategories: DWORD): BOOL; stdcall;
  1282. {$EXTERNALSYM FaxSetLoggingCategories}
  1283. {$ELSE}
  1284. function FaxSetLoggingCategories(FaxHandle: HANDLE; Categories: PFAX_LOG_CATEGORYA; NumberCategories: DWORD): BOOL; stdcall;
  1285. {$EXTERNALSYM FaxSetLoggingCategories}
  1286. {$ENDIF}
  1287. function FaxEnumPortsA(FaxHandle: HANDLE; var PortInfo: PFAX_PORT_INFOA; var PortsReturned: DWORD): BOOL; stdcall;
  1288. {$EXTERNALSYM FaxEnumPortsA}
  1289. function FaxEnumPortsW(FaxHandle: HANDLE; var PortInfo: PFAX_PORT_INFOW; var PortsReturned: DWORD): BOOL; stdcall;
  1290. {$EXTERNALSYM FaxEnumPortsW}
  1291. {$IFDEF UNICODE}
  1292. function FaxEnumPorts(FaxHandle: HANDLE; var PortInfo: PFAX_PORT_INFOW; var PortsReturned: DWORD): BOOL; stdcall;
  1293. {$EXTERNALSYM FaxEnumPorts}
  1294. {$ELSE}
  1295. function FaxEnumPorts(FaxHandle: HANDLE; var PortInfo: PFAX_PORT_INFOA; var PortsReturned: DWORD): BOOL; stdcall;
  1296. {$EXTERNALSYM FaxEnumPorts}
  1297. {$ENDIF}
  1298. function FaxGetPortA(FaxPortHandle: HANDLE; var PortInfo: PFAX_PORT_INFOA): BOOL; stdcall;
  1299. {$EXTERNALSYM FaxGetPortA}
  1300. function FaxGetPortW(FaxPortHandle: HANDLE; var PortInfo: PFAX_PORT_INFOW): BOOL; stdcall;
  1301. {$EXTERNALSYM FaxGetPortW}
  1302. {$IFDEF UNICODE}
  1303. function FaxGetPort(FaxPortHandle: HANDLE; var PortInfo: PFAX_PORT_INFOW): BOOL; stdcall;
  1304. {$EXTERNALSYM FaxGetPort}
  1305. {$ELSE}
  1306. function FaxGetPort(FaxPortHandle: HANDLE; var PortInfo: PFAX_PORT_INFOA): BOOL; stdcall;
  1307. {$EXTERNALSYM FaxGetPort}
  1308. {$ENDIF}
  1309. function FaxSetPortA(FaxPortHandle: HANDLE; const PortInfo: FAX_PORT_INFOA): BOOL; stdcall;
  1310. {$EXTERNALSYM FaxSetPortA}
  1311. function FaxSetPortW(FaxPortHandle: HANDLE; const PortInfo: FAX_PORT_INFOW): BOOL; stdcall;
  1312. {$EXTERNALSYM FaxSetPortW}
  1313. {$IFDEF UNICODE}
  1314. function FaxSetPort(FaxPortHandle: HANDLE; const PortInfo: FAX_PORT_INFOW): BOOL; stdcall;
  1315. {$EXTERNALSYM FaxSetPort}
  1316. {$ELSE}
  1317. function FaxSetPort(FaxPortHandle: HANDLE; const PortInfo: FAX_PORT_INFOA): BOOL; stdcall;
  1318. {$EXTERNALSYM FaxSetPort}
  1319. {$ENDIF}
  1320. function FaxEnumRoutingMethodsA(FaxPortHandle: HANDLE; var RoutingMethod: PFAX_ROUTING_METHODA; var MethodsReturned: DWORD): BOOL; stdcall;
  1321. {$EXTERNALSYM FaxEnumRoutingMethodsA}
  1322. function FaxEnumRoutingMethodsW(FaxPortHandle: HANDLE; var RoutingMethod: PFAX_ROUTING_METHODW; var MethodsReturned: DWORD): BOOL; stdcall;
  1323. {$EXTERNALSYM FaxEnumRoutingMethodsW}
  1324. {$IFDEF UNICODE}
  1325. function FaxEnumRoutingMethods(FaxPortHandle: HANDLE; var RoutingMethod: PFAX_ROUTING_METHODW; var MethodsReturned: DWORD): BOOL; stdcall;
  1326. {$EXTERNALSYM FaxEnumRoutingMethods}
  1327. {$ELSE}
  1328. function FaxEnumRoutingMethods(FaxPortHandle: HANDLE; var RoutingMethod: PFAX_ROUTING_METHODA; var MethodsReturned: DWORD): BOOL; stdcall;
  1329. {$EXTERNALSYM FaxEnumRoutingMethods}
  1330. {$ENDIF}
  1331. function FaxEnableRoutingMethodA(FaxPortHandle: HANDLE; RoutingGuid: LPCSTR; Enabled: BOOL): BOOL; stdcall;
  1332. {$EXTERNALSYM FaxEnableRoutingMethodA}
  1333. function FaxEnableRoutingMethodW(FaxPortHandle: HANDLE; RoutingGuid: LPCWSTR; Enabled: BOOL): BOOL; stdcall;
  1334. {$EXTERNALSYM FaxEnableRoutingMethodW}
  1335. {$IFDEF UNICODE}
  1336. function FaxEnableRoutingMethod(FaxPortHandle: HANDLE; RoutingGuid: LPCWSTR; Enabled: BOOL): BOOL; stdcall;
  1337. {$EXTERNALSYM FaxEnableRoutingMethod}
  1338. {$ELSE}
  1339. function FaxEnableRoutingMethod(FaxPortHandle: HANDLE; RoutingGuid: LPCSTR; Enabled: BOOL): BOOL; stdcall;
  1340. {$EXTERNALSYM FaxEnableRoutingMethod}
  1341. {$ENDIF}
  1342. function FaxEnumGlobalRoutingInfoA(FaxHandle: HANDLE; var RoutingInfo: PFAX_GLOBAL_ROUTING_INFOA; var MethodsReturned: DWORD): BOOL; stdcall;
  1343. {$EXTERNALSYM FaxEnumGlobalRoutingInfoA}
  1344. function FaxEnumGlobalRoutingInfoW(FaxHandle: HANDLE; var RoutingInfo: PFAX_GLOBAL_ROUTING_INFOW; var MethodsReturned: DWORD): BOOL; stdcall;
  1345. {$EXTERNALSYM FaxEnumGlobalRoutingInfoW}
  1346. {$IFDEF UNICODE}
  1347. function FaxEnumGlobalRoutingInfo(FaxHandle: HANDLE; var RoutingInfo: PFAX_GLOBAL_ROUTING_INFOW; var MethodsReturned: DWORD): BOOL; stdcall;
  1348. {$EXTERNALSYM FaxEnumGlobalRoutingInfo}
  1349. {$ELSE}
  1350. function FaxEnumGlobalRoutingInfo(FaxHandle: HANDLE; var RoutingInfo: PFAX_GLOBAL_ROUTING_INFOA; var MethodsReturned: DWORD): BOOL; stdcall;
  1351. {$EXTERNALSYM FaxEnumGlobalRoutingInfo}
  1352. {$ENDIF}
  1353. function FaxSetGlobalRoutingInfoA(FaxHandle: HANDLE; const RoutingInfo: FAX_GLOBAL_ROUTING_INFOA): BOOL; stdcall;
  1354. {$EXTERNALSYM FaxSetGlobalRoutingInfoA}
  1355. function FaxSetGlobalRoutingInfoW(FaxHandle: HANDLE; const RoutingInfo: FAX_GLOBAL_ROUTING_INFOW): BOOL; stdcall;
  1356. {$EXTERNALSYM FaxSetGlobalRoutingInfoW}
  1357. {$IFDEF UNICODE}
  1358. function FaxSetGlobalRoutingInfo(FaxHandle: HANDLE; const RoutingInfo: FAX_GLOBAL_ROUTING_INFOW): BOOL; stdcall;
  1359. {$EXTERNALSYM FaxSetGlobalRoutingInfo}
  1360. {$ELSE}
  1361. function FaxSetGlobalRoutingInfo(FaxHandle: HANDLE; const RoutingInfo: FAX_GLOBAL_ROUTING_INFOA): BOOL; stdcall;
  1362. {$EXTERNALSYM FaxSetGlobalRoutingInfo}
  1363. {$ENDIF}
  1364. function FaxGetRoutingInfoA(FaxPortHandle: HANDLE; RoutingGuid: LPCSTR; var RoutingInfoBuffer: LPBYTE; var RoutingInfoBufferSize: DWORD): BOOL; stdcall;
  1365. {$EXTERNALSYM FaxGetRoutingInfoA}
  1366. function FaxGetRoutingInfoW(FaxPortHandle: HANDLE; RoutingGuid: LPCWSTR; var RoutingInfoBuffer: LPBYTE; var RoutingInfoBufferSize: DWORD): BOOL; stdcall;
  1367. {$EXTERNALSYM FaxGetRoutingInfoW}
  1368. {$IFDEF UNICODE}
  1369. function FaxGetRoutingInfo(FaxPortHandle: HANDLE; RoutingGuid: LPCWSTR; var RoutingInfoBuffer: LPBYTE; var RoutingInfoBufferSize: DWORD): BOOL; stdcall;
  1370. {$EXTERNALSYM FaxGetRoutingInfo}
  1371. {$ELSE}
  1372. function FaxGetRoutingInfo(FaxPortHandle: HANDLE; RoutingGuid: LPCSTR; var RoutingInfoBuffer: LPBYTE; var RoutingInfoBufferSize: DWORD): BOOL; stdcall;
  1373. {$EXTERNALSYM FaxGetRoutingInfo}
  1374. {$ENDIF}
  1375. function FaxSetRoutingInfoA(FaxPortHandle: HANDLE; RoutingGuid: LPCSTR; RoutingInfoBuffer: LPBYTE; RoutingInfoBufferSize: DWORD): BOOL; stdcall;
  1376. {$EXTERNALSYM FaxSetRoutingInfoA}
  1377. function FaxSetRoutingInfoW(FaxPortHandle: HANDLE; RoutingGuid: LPCWSTR; RoutingInfoBuffer: LPBYTE; RoutingInfoBufferSize: DWORD): BOOL; stdcall;
  1378. {$EXTERNALSYM FaxSetRoutingInfoW}
  1379. {$IFDEF UNICODE}
  1380. function FaxSetRoutingInfo(FaxPortHandle: HANDLE; RoutingGuid: LPCWSTR; RoutingInfoBuffer: LPBYTE; RoutingInfoBufferSize: DWORD): BOOL; stdcall;
  1381. {$EXTERNALSYM FaxSetRoutingInfo}
  1382. {$ELSE}
  1383. function FaxSetRoutingInfo(FaxPortHandle: HANDLE; RoutingGuid: LPCSTR; RoutingInfoBuffer: LPBYTE; RoutingInfoBufferSize: DWORD): BOOL; stdcall;
  1384. {$EXTERNALSYM FaxSetRoutingInfo}
  1385. {$ENDIF}
  1386. function FaxInitializeEventQueue(FaxHandle: HANDLE; CompletionPort: HANDLE; CompletionKey: ULONG_PTR; hWnd: HWND; MessageStart: UINT): BOOL; stdcall;
  1387. {$EXTERNALSYM FaxInitializeEventQueue}
  1388. procedure FaxFreeBuffer(Buffer: LPVOID); stdcall;
  1389. {$EXTERNALSYM FaxFreeBuffer}
  1390. function FaxStartPrintJobA(PrinterName: LPCSTR; const PrintInfo: FAX_PRINT_INFOA; var FaxJobId: DWORD; FaxContextInfo: PFAX_CONTEXT_INFOA): BOOL; stdcall;
  1391. {$EXTERNALSYM FaxStartPrintJobA}
  1392. function FaxStartPrintJobW(PrinterName: LPCWSTR; const PrintInfo: FAX_PRINT_INFOW; var FaxJobId: DWORD; FaxContextInfo: PFAX_CONTEXT_INFOW): BOOL; stdcall;
  1393. {$EXTERNALSYM FaxStartPrintJobW}
  1394. {$IFDEF UNICODE}
  1395. function FaxStartPrintJob(PrinterName: LPCWSTR; const PrintInfo: FAX_PRINT_INFOW; var FaxJobId: DWORD; FaxContextInfo: PFAX_CONTEXT_INFOW): BOOL; stdcall;
  1396. {$EXTERNALSYM FaxStartPrintJob}
  1397. {$ELSE}
  1398. function FaxStartPrintJob(PrinterName: LPCSTR; const PrintInfo: FAX_PRINT_INFOA; var FaxJobId: DWORD; FaxContextInfo: PFAX_CONTEXT_INFOA): BOOL; stdcall;
  1399. {$EXTERNALSYM FaxStartPrintJob}
  1400. {$ENDIF}
  1401. function FaxPrintCoverPageA(const FaxContextInfo: FAX_CONTEXT_INFOA; const CoverPageInfo: FAX_COVERPAGE_INFOA): BOOL; stdcall;
  1402. {$EXTERNALSYM FaxPrintCoverPageA}
  1403. function FaxPrintCoverPageW(const FaxContextInfo: FAX_CONTEXT_INFOW; const CoverPageInfo: FAX_COVERPAGE_INFOW): BOOL; stdcall;
  1404. {$EXTERNALSYM FaxPrintCoverPageW}
  1405. {$IFDEF UNICODE}
  1406. function FaxPrintCoverPage(const FaxContextInfo: FAX_CONTEXT_INFOW; const CoverPageInfo: FAX_COVERPAGE_INFOW): BOOL; stdcall;
  1407. {$EXTERNALSYM FaxPrintCoverPage}
  1408. {$ELSE}
  1409. function FaxPrintCoverPage(const FaxContextInfo: FAX_CONTEXT_INFOA; const CoverPageInfo: FAX_COVERPAGE_INFOA): BOOL; stdcall;
  1410. {$EXTERNALSYM FaxPrintCoverPage}
  1411. {$ENDIF}
  1412. function FaxRegisterServiceProviderW(DeviceProvider: LPCWSTR; FriendlyName: LPCWSTR; ImageName: LPCWSTR; TspName: LPCWSTR): BOOL; stdcall;
  1413. {$EXTERNALSYM FaxRegisterServiceProviderW}
  1414. function FaxRegisterServiceProvider(DeviceProvider: LPCWSTR; FriendlyName: LPCWSTR; ImageName: LPCWSTR; TspName: LPCWSTR): BOOL;
  1415. {$EXTERNALSYM FaxRegisterServiceProvider}
  1416. type
  1417.   PFAX_ROUTING_INSTALLATION_CALLBACKW = function (FaxHandle: HANDLE; Context: LPVOID; MethodName, FriendlyName, FunctionName, Guid: LPWSTR): BOOL; stdcall;
  1418.   {$EXTERNALSYM PFAX_ROUTING_INSTALLATION_CALLBACKW}
  1419.   TFaxRoutingInstallationCallbackW = PFAX_ROUTING_INSTALLATION_CALLBACKW;
  1420.   PFAX_ROUTING_INSTALLATION_CALLBACK = PFAX_ROUTING_INSTALLATION_CALLBACKW;
  1421.   {$EXTERNALSYM PFAX_ROUTING_INSTALLATION_CALLBACK}
  1422.   TFaxRoutingInstallationCallback = TFaxRoutingInstallationCallbackW;
  1423. function FaxRegisterRoutingExtensionW(FaxHandle: HANDLE; ExtensionName, FriendlyName, ImageName: LPCWSTR; CallBack: PFAX_ROUTING_INSTALLATION_CALLBACKW; Context: LPVOID): BOOL; stdcall;
  1424. {$EXTERNALSYM FaxRegisterRoutingExtensionW}
  1425. function FaxRegisterRoutingExtension(FaxHandle: HANDLE; ExtensionName, FriendlyName, ImageName: LPCWSTR; CallBack: PFAX_ROUTING_INSTALLATION_CALLBACKW; Context: LPVOID): BOOL;
  1426. {$EXTERNALSYM FaxRegisterRoutingExtension}
  1427. function FaxUnregisterRoutingExtensionA(hFaxHandle: HANDLE; lpctstrExtensionName: LPCSTR): BOOL; stdcall;
  1428. {$EXTERNALSYM FaxUnregisterRoutingExtensionA}
  1429. function FaxUnregisterRoutingExtensionW(hFaxHandle: HANDLE; lpctstrExtensionName: LPCWSTR): BOOL; stdcall;
  1430. {$EXTERNALSYM FaxUnregisterRoutingExtensionW}
  1431. {$IFDEF UNICODE}
  1432. function FaxUnregisterRoutingExtension(hFaxHandle: HANDLE; lpctstrExtensionName: LPCWSTR): BOOL; stdcall;
  1433. {$EXTERNALSYM FaxUnregisterRoutingExtension}
  1434. {$ELSE}
  1435. function FaxUnregisterRoutingExtension(hFaxHandle: HANDLE; lpctstrExtensionName: LPCSTR): BOOL; stdcall;
  1436. {$EXTERNALSYM FaxUnregisterRoutingExtension}
  1437. {$ENDIF}
  1438. function FaxAccessCheck(FaxHandle: HANDLE; AccessMask: DWORD): BOOL; stdcall;
  1439. {$EXTERNALSYM FaxAccessCheck}
  1440. //
  1441. // Fax Specific Access Rights
  1442. //
  1443. const
  1444.   FAX_JOB_SUBMIT   = ($0001);
  1445.   {$EXTERNALSYM FAX_JOB_SUBMIT}
  1446.   FAX_JOB_QUERY    = ($0002);
  1447.   {$EXTERNALSYM FAX_JOB_QUERY}
  1448.   FAX_CONFIG_QUERY = ($0004);
  1449.   {$EXTERNALSYM FAX_CONFIG_QUERY}
  1450.   FAX_CONFIG_SET   = ($0008);
  1451.   {$EXTERNALSYM FAX_CONFIG_SET}
  1452.   FAX_PORT_QUERY   = ($0010);
  1453.   {$EXTERNALSYM FAX_PORT_QUERY}
  1454.   FAX_PORT_SET     = ($0020);
  1455.   {$EXTERNALSYM FAX_PORT_SET}
  1456.   FAX_JOB_MANAGE   = ($0040);
  1457.   {$EXTERNALSYM FAX_JOB_MANAGE}
  1458.   FAX_READ = (STANDARD_RIGHTS_READ or FAX_JOB_QUERY or FAX_CONFIG_QUERY or FAX_PORT_QUERY);
  1459.   {$EXTERNALSYM FAX_READ}
  1460.   FAX_WRITE = (STANDARD_RIGHTS_WRITE or FAX_JOB_SUBMIT );
  1461.   {$EXTERNALSYM FAX_WRITE}
  1462.   FAX_ALL_ACCESS = (STANDARD_RIGHTS_ALL or FAX_JOB_SUBMIT or FAX_JOB_QUERY or FAX_CONFIG_QUERY or FAX_CONFIG_SET or FAX_PORT_QUERY or FAX_PORT_SET or FAX_JOB_MANAGE);
  1463.   {$EXTERNALSYM FAX_ALL_ACCESS}
  1464. implementation
  1465. const
  1466.   winfax = 'winfax.dll';
  1467. function FaxConnectFaxServerA; external winfax name 'FaxConnectFaxServerA';
  1468. function FaxConnectFaxServerW; external winfax name 'FaxConnectFaxServerW';
  1469. {$IFDEF UNICODE}
  1470. function FaxConnectFaxServer; external winfax name 'FaxConnectFaxServerW';
  1471. {$ELSE}
  1472. function FaxConnectFaxServer; external winfax name 'FaxConnectFaxServerA';
  1473. {$ENDIF}
  1474. function FaxClose; external winfax name 'FaxClose';
  1475. function FaxOpenPort; external winfax name 'FaxOpenPort';
  1476. function FaxCompleteJobParamsA; external winfax name 'FaxCompleteJobParamsA';
  1477. function FaxCompleteJobParamsW; external winfax name 'FaxCompleteJobParamsW';
  1478. {$IFDEF UNICODE}
  1479. function FaxCompleteJobParams; external winfax name 'FaxCompleteJobParamsW';
  1480. {$ELSE}
  1481. function FaxCompleteJobParams; external winfax name 'FaxCompleteJobParamsA';
  1482. {$ENDIF}
  1483. function FaxSendDocumentA; external winfax name 'FaxSendDocumentA';
  1484. function FaxSendDocumentW; external winfax name 'FaxSendDocumentW';
  1485. {$IFDEF UNICODE}
  1486. function FaxSendDocument; external winfax name 'FaxSendDocumentW';
  1487. {$ELSE}
  1488. function FaxSendDocument; external winfax name 'FaxSendDocumentA';
  1489. {$ENDIF}
  1490. function FaxSendDocumentForBroadcastA; external winfax name 'FaxSendDocumentForBroadcastA';
  1491. function FaxSendDocumentForBroadcastW; external winfax name 'FaxSendDocumentForBroadcastW';
  1492. {$IFDEF UNICODE}
  1493. function FaxSendDocumentForBroadcast; external winfax name 'FaxSendDocumentForBroadcastW';
  1494. {$ELSE}
  1495. function FaxSendDocumentForBroadcast; external winfax name 'FaxSendDocumentForBroadcastA';
  1496. {$ENDIF}
  1497. function FaxEnumJobsA; external winfax name 'FaxEnumJobsA';
  1498. function FaxEnumJobsW; external winfax name 'FaxEnumJobsW';
  1499. {$IFDEF UNICODE}
  1500. function FaxEnumJobs; external winfax name 'FaxEnumJobsW';
  1501. {$ELSE}
  1502. function FaxEnumJobs; external winfax name 'FaxEnumJobsA';
  1503. {$ENDIF}
  1504. function FaxGetJobA; external winfax name 'FaxGetJobA';
  1505. function FaxGetJobW; external winfax name 'FaxGetJobW';
  1506. {$IFDEF UNICODE}
  1507. function FaxGetJob; external winfax name 'FaxGetJobW';
  1508. {$ELSE}
  1509. function FaxGetJob; external winfax name 'FaxGetJobA';
  1510. {$ENDIF}
  1511. function FaxSetJobA; external winfax name 'FaxSetJobA';
  1512. function FaxSetJobW; external winfax name 'FaxSetJobW';
  1513. {$IFDEF UNICODE}
  1514. function FaxSetJob; external winfax name 'FaxSetJobW';
  1515. {$ELSE}
  1516. function FaxSetJob; external winfax name 'FaxSetJobA';
  1517. {$ENDIF}
  1518. function FaxGetPageData; external winfax name 'FaxGetPageData';
  1519. function FaxGetDeviceStatusA; external winfax name 'FaxGetDeviceStatusA';
  1520. function FaxGetDeviceStatusW; external winfax name 'FaxGetDeviceStatusW';
  1521. {$IFDEF UNICODE}
  1522. function FaxGetDeviceStatus; external winfax name 'FaxGetDeviceStatusW';
  1523. {$ELSE}
  1524. function FaxGetDeviceStatus; external winfax name 'FaxGetDeviceStatusA';
  1525. {$ENDIF}
  1526. function FaxAbort; external winfax name 'FaxAbort';
  1527. function FaxGetConfigurationA; external winfax name 'FaxGetConfigurationA';
  1528. function FaxGetConfigurationW; external winfax name 'FaxGetConfigurationW';
  1529. {$IFDEF UNICODE}
  1530. function FaxGetConfiguration; external winfax name 'FaxGetConfigurationW';
  1531. {$ELSE}
  1532. function FaxGetConfiguration; external winfax name 'FaxGetConfigurationA';
  1533. {$ENDIF}
  1534. function FaxSetConfigurationA; external winfax name 'FaxSetConfigurationA';
  1535. function FaxSetConfigurationW; external winfax name 'FaxSetConfigurationW';
  1536. {$IFDEF UNICODE}
  1537. function FaxSetConfiguration; external winfax name 'FaxSetConfigurationW';
  1538. {$ELSE}
  1539. function FaxSetConfiguration; external winfax name 'FaxSetConfigurationA';
  1540. {$ENDIF}
  1541. function FaxGetLoggingCategoriesA; external winfax name 'FaxGetLoggingCategoriesA';
  1542. function FaxGetLoggingCategoriesW; external winfax name 'FaxGetLoggingCategoriesW';
  1543. {$IFDEF UNICODE}
  1544. function FaxGetLoggingCategories; external winfax name 'FaxGetLoggingCategoriesW';
  1545. {$ELSE}
  1546. function FaxGetLoggingCategories; external winfax name 'FaxGetLoggingCategoriesA';
  1547. {$ENDIF}
  1548. function FaxSetLoggingCategoriesA; external winfax name 'FaxSetLoggingCategoriesA';
  1549. function FaxSetLoggingCategoriesW; external winfax name 'FaxSetLoggingCategoriesW';
  1550. {$IFDEF UNICODE}
  1551. function FaxSetLoggingCategories; external winfax name 'FaxSetLoggingCategoriesW';
  1552. {$ELSE}
  1553. function FaxSetLoggingCategories; external winfax name 'FaxSetLoggingCategoriesA';
  1554. {$ENDIF}
  1555. function FaxEnumPortsA; external winfax name 'FaxEnumPortsA';
  1556. function FaxEnumPortsW; external winfax name 'FaxEnumPortsW';
  1557. {$IFDEF UNICODE}
  1558. function FaxEnumPorts; external winfax name 'FaxEnumPortsW';
  1559. {$ELSE}
  1560. function FaxEnumPorts; external winfax name 'FaxEnumPortsA';
  1561. {$ENDIF}
  1562. function FaxGetPortA; external winfax name 'FaxGetPortA';
  1563. function FaxGetPortW; external winfax name 'FaxGetPortW';
  1564. {$IFDEF UNICODE}
  1565. function FaxGetPort; external winfax name 'FaxGetPortW';
  1566. {$ELSE}
  1567. function FaxGetPort; external winfax name 'FaxGetPortA';
  1568. {$ENDIF}
  1569. function FaxSetPortA; external winfax name 'FaxSetPortA';
  1570. function FaxSetPortW; external winfax name 'FaxSetPortW';
  1571. {$IFDEF UNICODE}
  1572. function FaxSetPort; external winfax name 'FaxSetPortW';
  1573. {$ELSE}
  1574. function FaxSetPort; external winfax name 'FaxSetPortA';
  1575. {$ENDIF}
  1576. function FaxEnumRoutingMethodsA; external winfax name 'FaxEnumRoutingMethodsA';
  1577. function FaxEnumRoutingMethodsW; external winfax name 'FaxEnumRoutingMethodsW';
  1578. {$IFDEF UNICODE}
  1579. function FaxEnumRoutingMethods; external winfax name 'FaxEnumRoutingMethodsW';
  1580. {$ELSE}
  1581. function FaxEnumRoutingMethods; external winfax name 'FaxEnumRoutingMethodsA';
  1582. {$ENDIF}
  1583. function FaxEnableRoutingMethodA; external winfax name 'FaxEnableRoutingMethodA';
  1584. function FaxEnableRoutingMethodW; external winfax name 'FaxEnableRoutingMethodW';
  1585. {$IFDEF UNICODE}
  1586. function FaxEnableRoutingMethod; external winfax name 'FaxEnableRoutingMethodW';
  1587. {$ELSE}
  1588. function FaxEnableRoutingMethod; external winfax name 'FaxEnableRoutingMethodA';
  1589. {$ENDIF}
  1590. function FaxEnumGlobalRoutingInfoA; external winfax name 'FaxEnumGlobalRoutingInfoA';
  1591. function FaxEnumGlobalRoutingInfoW; external winfax name 'FaxEnumGlobalRoutingInfoW';
  1592. {$IFDEF UNICODE}
  1593. function FaxEnumGlobalRoutingInfo; external winfax name 'FaxEnumGlobalRoutingInfoW';
  1594. {$ELSE}
  1595. function FaxEnumGlobalRoutingInfo; external winfax name 'FaxEnumGlobalRoutingInfoA';
  1596. {$ENDIF}
  1597. function FaxSetGlobalRoutingInfoA; external winfax name 'FaxSetGlobalRoutingInfoA';
  1598. function FaxSetGlobalRoutingInfoW; external winfax name 'FaxSetGlobalRoutingInfoW';
  1599. {$IFDEF UNICODE}
  1600. function FaxSetGlobalRoutingInfo; external winfax name 'FaxSetGlobalRoutingInfoW';
  1601. {$ELSE}
  1602. function FaxSetGlobalRoutingInfo; external winfax name 'FaxSetGlobalRoutingInfoA';
  1603. {$ENDIF}
  1604. function FaxGetRoutingInfoA; external winfax name 'FaxGetRoutingInfoA';
  1605. function FaxGetRoutingInfoW; external winfax name 'FaxGetRoutingInfoW';
  1606. {$IFDEF UNICODE}
  1607. function FaxGetRoutingInfo; external winfax name 'FaxGetRoutingInfoW';
  1608. {$ELSE}
  1609. function FaxGetRoutingInfo; external winfax name 'FaxGetRoutingInfoA';
  1610. {$ENDIF}
  1611. function FaxSetRoutingInfoA; external winfax name 'FaxSetRoutingInfoA';
  1612. function FaxSetRoutingInfoW; external winfax name 'FaxSetRoutingInfoW';
  1613. {$IFDEF UNICODE}
  1614. function FaxSetRoutingInfo; external winfax name 'FaxSetRoutingInfoW';
  1615. {$ELSE}
  1616. function FaxSetRoutingInfo; external winfax name 'FaxSetRoutingInfoA';
  1617. {$ENDIF}
  1618. function FaxInitializeEventQueue; external winfax name 'FaxInitializeEventQueue';
  1619. procedure FaxFreeBuffer; external winfax name 'FaxFreeBuffer';
  1620. function FaxStartPrintJobA; external winfax name 'FaxStartPrintJobA';
  1621. function FaxStartPrintJobW; external winfax name 'FaxStartPrintJobW';
  1622. {$IFDEF UNICODE}
  1623. function FaxStartPrintJob; external winfax name 'FaxStartPrintJobW';
  1624. {$ELSE}
  1625. function FaxStartPrintJob; external winfax name 'FaxStartPrintJobA';
  1626. {$ENDIF}
  1627. function FaxPrintCoverPageA; external winfax name 'FaxPrintCoverPageA';
  1628. function FaxPrintCoverPageW; external winfax name 'FaxPrintCoverPageW';
  1629. {$IFDEF UNICODE}
  1630. function FaxPrintCoverPage; external winfax name 'FaxPrintCoverPageW';
  1631. {$ELSE}
  1632. function FaxPrintCoverPage; external winfax name 'FaxPrintCoverPageA';
  1633. {$ENDIF}
  1634. function FaxRegisterServiceProviderW; external winfax name 'FaxRegisterServiceProviderW';
  1635. function FaxRegisterServiceProvider(DeviceProvider: LPCWSTR; FriendlyName: LPCWSTR; ImageName: LPCWSTR; TspName: LPCWSTR): BOOL;
  1636. begin
  1637.   Result := FaxRegisterServiceProvider(DeviceProvider, FriendlyName, ImageName, TspName);
  1638. end;
  1639. function FaxRegisterRoutingExtensionW; external winfax name 'FaxRegisterRoutingExtensionW';
  1640. function FaxRegisterRoutingExtension(FaxHandle: HANDLE; ExtensionName, FriendlyName, ImageName: LPCWSTR; CallBack: PFAX_ROUTING_INSTALLATION_CALLBACKW; Context: LPVOID): BOOL;
  1641. begin
  1642.   Result := FaxRegisterRoutingExtension(FaxHandle, ExtensionName, FriendlyName, ImageName, CallBack, Context);
  1643. end;
  1644. function FaxUnregisterRoutingExtensionA; external winfax name 'FaxUnregisterRoutingExtensionA';
  1645. function FaxUnregisterRoutingExtensionW; external winfax name 'FaxUnregisterRoutingExtensionW';
  1646. {$IFDEF UNICODE}
  1647. function FaxUnregisterRoutingExtension; external winfax name 'FaxUnregisterRoutingExtensionW';
  1648. {$ELSE}
  1649. function FaxUnregisterRoutingExtension; external winfax name 'FaxUnregisterRoutingExtensionA';
  1650. {$ENDIF}
  1651. function FaxAccessCheck; external winfax name 'FaxAccessCheck';
  1652. end.