
I have been looking for code and tried using SetJob (winspool.drv) but I don't have the JobID's associated with the jobs in the queue so I can't set them to cancel. What I would like to do is when the application starts up, clear all jobs found in the print queue for the local attached printer. When you then restart the application the same steps will be followed and it will add a new job to the queue which in turn will then return an error when trying to execute StartDocPrinter (this function times out) and the application will then not start-up.

If you restart the application before this is done, or end task it, the print job will stay in the queue and not be removed. Sometimes when the application starts up with no tickets loaded in the printer a test print file will be in the printer queue but will usually be removed after the code has returned out of ticket status from the printer buffer. I communicate with the printer using winspool.drv functionality.


I'm currently developing a kiosk system making use of a BOCA printer on USB port for ticket printing purposes.
