The WritePrinter function informs the print spooler that data should be written to the specified printer.
BOOL WritePrinter(
HANDLE hPrinter,
// handle to printer object
LPVOID pBuf, // pointer to array that contains printer data
DWORD cbBuf, // size, in bytes, of array
LPDWORD pcWritten
// addr. of variable with count of bytes written
);
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.
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.
Printing and Print Spooler Overview, Printing and Print Spooler Functions, OpenPrinter