JOB

typedef struct tagJOB { /* job */

DWORD cVersion;

DWORD JobId;

LPPRINTERSERVER lpPrinterServer;

LPTSTR lpPrinterName;

LPTSTR lpUserName;

LPTSTR lpDocument;

LPTSTR lpNotifyName;

LPTSTR lpDatatype;

LPTSTR lpPrintProcessor;

LPTSTR lpParameters;

LPTSTR lpDriverName;

LPDEVMODE lpDevMode;

LPTSTR lpStatus;

DWORD Status;

DWORD Priority;

DWORD Position;

SYSTEMTIME StartTime;

SYSTEMTIME UntilTime;

DWORD TotalPages;

DWORD PagesPrinted;

DWORD Size;

SYSTEMTIME Submitted;

SYSTEMTIME Time;

} JOB;

The JOB structure contains information about a print job.

Members

cVersion

Specifies this structure's version number. This allows the system to deal with future compatibility issues. For Windows 32, set this field to 32.

JobId

Specifies a unique identifier for this print job.

lpPrinterServer

Pointer to a PRINTERSERVER data structure that describes the printer server where this print job's printer resides.

lpPrinterName

Pointer to a string that is the name of the print job's printer.

lpUserName

Pointer to a string that is the name of the user who submitted the print job.

lpDocument

Pointer to a string that is the document name of the print job.

lpNotifyName

Pointer to a string that is the name or alias to be notified when the state of the print job is modified.

lpDatatype

Pointer to a string that is the print job's data type. This data type must be supported by the print job's print processor.

lpPrintProcessor

Pointer to a string that is the name of the print processor to use when the print job is scheduled to the printer.

lpParameters

Pointer to a string that contains the print processor parameters this print job will use.

lpDriverName

Pointer to a zero-terminated string that names the print job's printer driver. Printer driver names have the form Driver.Model, with both the prefix and suffix parts of the name following standard file system naming conventions.

lpDevMode

Pointer to a DEVMODE structure for the print job.

lpStatus

Pointer to a string that describes the state of the print job.

Status

Specifies the state of the print job. Consists of a set of bit flags. The following values have meaning:

Value Meaning

JOB_PAUSED The print job is paused.
JOB_SPOOLING The print job is spooling. It is being created.
JOB_PRINTING The print job is printing.
JOB_INTERV User intervention is required.
JOB_ERROR An error occurred. The string pointed to by lpStatus contains further information.
JOB_OFF-LINE The printer is off-line.
JOB_NOPAPER The printer is out of paper.
JOB_FORMCHG The printer is waiting for a form change.
JOB_CRTCHG The printer is waiting for a cartridge change.
JOB_PENCHG The printer is waiting for a pen change.
JOB_DELETED The print job has been deleted.

Priority

Specifies the priority of the print job. The lower the value, the higher the priority. A value of 1 indicates highest priority.

Position

Specifies the position of the print job in the printer's list of print jobs. A value of 1 indicates the top of the list.

StartTime

Specifies the earliest time at which this print job can be printed.

UntilTime

Specifies the latest time at which this print job can be printed.

TotalPages

Specifies the number of pages in this print job. A value of zero means the number of pages is unknown.

PagesPrinted

If TotalPages is non-zero, this field contains the number of pages of this print job already printed. If TotalPages is zero, this field contains the amount of data, in bytes, already sent to the printer.

Size

The size in bytes of the spooled print job.

Submitted

Specifies when the print job was submitted.

Time

Specifies how long the print job has been printing.

See Also

PRINTER, PRINTERSERVER