Επεξεργασία

Κοινή χρήση μέσω


JOB_INFO_1 structure

The JOB_INFO_1 structure specifies print-job information such as the job-identifier value, the name of the printer for which the job is spooled, the name of the machine that created the print job, the name of the user that owns the print job, and so on.

Syntax

typedef struct _JOB_INFO_1 {
  DWORD      JobId;
  LPTSTR     pPrinterName;
  LPTSTR     pMachineName;
  LPTSTR     pUserName;
  LPTSTR     pDocument;
  LPTSTR     pDatatype;
  LPTSTR     pStatus;
  DWORD      Status;
  DWORD      Priority;
  DWORD      Position;
  DWORD      TotalPages;
  DWORD      PagesPrinted;
  SYSTEMTIME Submitted;
} JOB_INFO_1, *PJOB_INFO_1;

Members

JobId

A job identifier.

pPrinterName

A pointer to a null-terminated string that specifies the name of the printer for which the job is spooled.

pMachineName

A pointer to a null-terminated string that specifies the name of the machine that created the print job.

pUserName

A pointer to a null-terminated string that specifies the name of the user that owns the print job.

pDocument

A pointer to a null-terminated string that specifies the name of the print job (for example, "MS-WORD: Review.doc").

pDatatype

A pointer to a null-terminated string that specifies the type of data used to record the print job.

pStatus

A pointer to a null-terminated string that specifies the status of the print job. This member should be checked prior to Status and, if pStatus is NULL, the status is defined by the contents of the Status member.

Status

The job status. The value of this member can be zero or a combination of one or more of the following values. A value of zero indicates that the print queue was paused after the document finished spooling.

Value Meaning
JOB_STATUS_BLOCKED_DEVQ The driver cannot print the job.
JOB_STATUS_COMPLETE Windows XP and later: Job is sent to the printer, but the job may not be printed yet.
See Remarks for more information.
JOB_STATUS_DELETED Job has been deleted.
JOB_STATUS_DELETING Job is being deleted.
JOB_STATUS_ERROR An error is associated with the job.
JOB_STATUS_OFFLINE Printer is offline.
JOB_STATUS_PAPEROUT Printer is out of paper.
JOB_STATUS_PAUSED Job is paused.
JOB_STATUS_PRINTED Job has printed.
JOB_STATUS_PRINTING Job is printing.
JOB_STATUS_RESTART Job has been restarted.
JOB_STATUS_RETAINED Windows Vista and later: Job has been retained in the print queue and cannot be deleted. This can be caused by the following:
1) The job was manually retained by a call to SetJob and the spooler is waiting for the job to be released.
2) The job has not finished printing and must finish printing before it can be automatically deleted.
See SetJob for more information about print job commands.
JOB_STATUS_SPOOLING Job is spooling.
JOB_STATUS_USER_INTERVENTION Printer has an error that requires the user to do something.

Priority

The job priority. This member can be one of the following values or in the range between 1 through 99 (MIN_PRIORITY through MAX_PRIORITY).

Value Meaning
MIN_PRIORITY Minimum priority.
MAX_PRIORITY Maximum priority.
DEF_PRIORITY Default priority.

Position

The job's position in the print queue.

TotalPages

The total number of pages that the document contains. This value may be zero if the print job does not contain page delimiting information.

PagesPrinted

The number of pages that have printed. This value may be zero if the print job does not contain page delimiting information.

Submitted

A SYSTEMTIME structure that specifies the time that this document was spooled.

This time value is in Universal Time Coordinate (UTC) format. You should convert it to a local time value before displaying it. You can use the FileTimeToLocalFileTime function to perform the conversion.

Remarks

Port monitors that do not support TrueEndOfJob will set the job as JOB_STATUS_PRINTED right after the job is submitted to the printer.

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Winspool.h (include Windows.h)
Unicode and ANSI names
_JOB_INFO_1W (Unicode) and _JOB_INFO_1A (ANSI)

See also

Printing

Print Spooler API Structures

EnumJobs

GetJob

SetJob