views:

25

answers:

1

I am new to the C++ program. How to send the job to the printer and how to delete the jobs from the printer which is yet to be printed using win32 API.

A: 

Open a handle to a printer using the OpenPrinter API call. Alternatively you might get this handle from the Printers unit in the VCL instead. When you have the handle you can use the SetPrinter API call to reset (purge) the printer queue. Simply pass the PRINTER_CONTROL_PURGE as the command parameter.

I found a simple example using VB (here), which shows the use of the commands, if I find the time can make a somewhat similar example using C++.

TommyA