Platform SDK: Fax Services

FaxSetJob

A fax client application calls the FaxSetJob function to pause, resume, cancel, or restart a specified fax job.

BOOL WINAPI FaxSetJob(
  HANDLE FaxHandle,        // handle to the fax server
  DWORD JobId,             // fax job identifier
  DWORD Command,           // job command value
  CONST FAX_JOB_ENTRY *JobEntry 
                           // pointer to job information structure
);

Parameters

FaxHandle
[in] Specifies a fax server handle returned by a call to the FaxConnectFaxServer function.
JobId
[in] Specifies a DWORD variable that is a unique number to identify the fax job to modify. Call the FaxEnumJobs function to retrieve a valid fax job identifier to use in the JobId parameter.
Command
[in] Specifies a DWORD variable that indicates the job command to perform. This parameter can be one of the following values.
Value Meaning
JC_DELETE Cancel the specified fax job. The job can be active or queued.
JC_PAUSE Pause the specified queued fax job. If the fax job is active, the fax service pauses the job when it returns to the queued state.
JC_RESUME Resume the paused fax job.
JC_RESTART Restart the specified fax job.

JobEntry
[in] Pointer to a FAX_JOB_ENTRY structure that contains information about the attributes of the fax job. The data can include, among other items, the job type and status, recipient and sender identification, scheduling and delivery settings, and the page count.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError can return one of the following errors.

Error code Description
ERROR_ACCESS_DENIED Access is denied. You must own the job or have FAX_JOB_MANAGE access.
ERROR_INVALID_PARAMETER The FaxHandle parameter is NULL, or one or all of the Command, JobEntry, or JobID parameters are invalid.

Remarks

An application typically calls the FaxSetJob function to manage a queued fax job. To terminate a fax transmission that is in progress, an application can call the FaxAbort function.

For more information, see Modifying a Fax Job and Terminating a Fax Job.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable with BackOffice Small Business Server.
  Header: Declared in Winfax.h.
  Library: Included as a resource in Winfax.dll.
  Unicode: Implemented as Unicode and ANSI versions on all platforms.

See Also

Fax Service Client Application Programming Interface Overview, Fax Service Client API Functions, FaxSendDocument, FaxStartPrintJob, FaxConnectFaxServer, FaxAbort, FaxEnumJobs, FaxGetJob, FAX_JOB_ENTRY