GetPrintJobStatus
Rendering and printing
Description
Queries or controls one print job in the Windows spooler through a status-code selector
The job is opened by identifier on the named printer and the status code picks the field to read or the action to run
Syntax
Delphi
Function GetPrintJobStatus(StatusCode, JobID: Integer; Const PrinterName: AnsiString): Integer;Parameters
| StatusCode | Selector from the tables below |
|---|---|
| JobID | Spooler job identifier of the job to inspect |
| PrinterName | Name of the printer holding the job; an empty name fails |
Return values
| The queried value, 1 for a successful control action, or 0 when the printer or job cannot be opened or the code is unknown |
Remarks
Query codes read job fields: 200 job exists, 201 job id, 202 priority, 203 queue position, 204 total pages, 205 pages printed, 206 milliseconds since submission, 207 datatype class with 1 RAW, 2 EMF, 3 TEXT and 4 XPS
Status codes probe the spooler bits: 300 returns the raw status mask and 301 through 314 return 1 when the job is paused, in error, deleting, spooling, printing, offline, out of paper, printed, deleted, blocked, awaiting user intervention, restarted, complete or retained
Control codes act on the job: 401 pauses it, 402 resumes it and 403 deletes it
See also
GetPrinterCapabilities, GetPrinterNames, PrintRaw24BitBGRData