The EnumJobs function initializes an array of either JOB_INFO_1 or JOB_INFO_2 structures with data describing the specified print jobs for the specified printer.
BOOL EnumJobs(
HANDLE hPrinter, // handle to printer object
DWORD FirstJob, // location of first job in print queue to
// enumerate
DWORD NoJobs, // number of jobs to enumerate
DWORD Level, // structure level
LPBYTE pJob, // pointer to structure array
DWORD cbBuf, // size of array, in bytes
LPDWORD pcbNeeded, // addr. of variable with no. of bytes copied
// (or required)
LPDWORD pcReturned // addr. of variable with no. of job info.
// structures copied
);
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.
The handle hPrinter is obtained by calling the OpenPrinter function.
The JOB_INFO_1 structure contains general print-job information; the JOB_INFO_2 structure has much more detailed information.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winspool.h.
Import Library: Use winspool.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Printing and Print Spooler Overview, Printing and Print Spooler Functions, GetJob, JOB_INFO_1, JOB_INFO_2, OpenPrinter, SetJob