File Feedback

I am trying to print multiple PDF files using some Pdf readers launched using shellExecute in Delphi 2007.

The reliability of this approach may not be very good, as actual printing may fail for several reasons. I am wondering if there is a way for my program to find out if the file is really being sent to the print spooler?

+4
source share
1 answer

To track printer jobs, you can use the FindFirstPrinterChangeNotification API call with the PRINTER_CHANGE_WRITE_JOB passed in the fdwFilter parameter. This will let you know every time job data has been written to the printer through FindNextPrinterChangeNotification .

When you're done, remember to call FindClosePrinterChangeNotification to close all the handles and clear it.

Use can be quite complicated. Dr. Peter Below TeamB has posted a block that wraps around it some time ago to the old Borland Code Central pages (now available on the Embarcadero website) in the PBPrintersMonitorU.pas . You can find it here if you have an EDN (Embarcadero Developers Network).

+6
source

All Articles