A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



EnumJobs

The EnumJobs function retrieves information about a specified set of print jobs for a specified printer.

VB4-32,5,6
Declare Function EnumJobs Lib "winspool.drv" Alias "EnumJobsA" (ByVal hPrinter As Long, ByVal FirstJob As Long, ByVal NoJobs As Long, ByVal Level As Long, pJob As Any, ByVal cdBuf As Long, pcbNeeded As Long, pcReturned As Long) As Long

Operating Systems Supported
Requires Windows NT 3.1 or later; Requires Windows 95 or later

Library
Winspool

Parameter Information
- hPrinter
[in] Handle to the printer object whose print jobs the function enumerates. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.

- FirstJob
[in] Specifies the zero-based position within the print queue of the first print job to enumerate. For example, a value of 0 specifies that enumeration should begin at the first print job in the print queue; a value of 9 specifies that enumeration should begin at the tenth print job in the print queue.

- NoJobs
[in] Specifies the total number of print jobs to enumerate.

- Level
[in] Specifies the type of information returned in the pJob buffer. If Level is 1, pJob receives an array of JOB_INFO_1 structures. If Level is 2, pJob receives an array of JOB_INFO_2 structures.

- pJob
[out] Pointer to a buffer that receives an array of JOB_INFO_1 or JOB_INFO_2 structures. The buffer must be large enough to receive the array of structures and any strings or other data to which the structure members point.
To determine the required buffer size, call EnumJobs with cbBuf set to zero. EnumJobs fails, GetLastError returns ERROR_INSUFFICIENT_BUFFER, and the pcbNeeded parameter returns the size, in bytes, of the buffer required to hold the array of structures and their data.

- cbBuf
[in] Specifies the size, in bytes, of the pJob buffer.

- pcbNeeded
[out] Pointer to a variable that receives the number of bytes copied if the function succeeds. If the function fails, the variable receives the number of bytes required.

- pcReturned
[out] Pointer to a variable that receives the number of JOB_INFO_1 or JOB_INFO_2 structures returned in the pJob buffer.

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.

Last update: 07 April 2006