StartDocPrinter

The StartDocPrinter function informs the print spooler that a document is to be spooled for printing.

DWORD StartDocPrinter(
  HANDLE hPrinter,  // handle to printer object
  DWORD Level,      // structure level
  LPBYTE pDocInfo   // address of structure
);
 

Parameters

hPrinter
Handle to the printer.
Level
Specifies the version of the structure to which pDocInfo points.

Windows NT: This value must be 1.

Windows 95: This value can be 1 or 2.

pDocInfo
Pointer to a structure that describes the document to print.

Windows NT: pDocInfo is a pointer to a DOC_INFO_1 structure.

Windows 95: pDocInfo is a pointer to a DOC_INFO_1 or a DOC_INFO_2 structure.

Return Values

If the function succeeds, the return value identifies the print job.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The printer handle identified by the hPrinter parameter is obtained by calling the OpenPrinter function.

The return value will never be greater than 2^31 – 1.

QuickInfo

  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.

See Also

Printing and Print Spooler Overview, Printing and Print Spooler Functions, DOC_INFO_1, DOC_INFO_2, OpenPrinter