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.