Posted: Mon Jul 01, 2013 9:02 am Post subject: Hooking Printing? Possible?
Just thought about that today...
is it possible to hook the printing process?? (so when i print my desired documents, the printer would print other document instead)
I found that there's an api for printers in Gdi32.dll but i don't know if that's the way i suppose to do it because that's not a local printer, but a network printer, so i assume i could hook the local process that sends the documents to be printed...
As far as I can tell [but I'm no expert], you don't need to hook anything to do this.
You simply just monitor the printer job queue using FindFirstPrinterChangeNotification/FindNextPrinterChangeNotification and then catch any PRINTER_CHANGE_ADD_JOB|PRINTER_CHANGE_WRITE_JOB calls. As far as editing what's to be printing goes?
If I was in your shoes and wanted a simple solution, I'd cancel the current job and just create another one with your data. It seems to be a bit of a hassle to grab what's about to be printed and then modify it.
As far as I can tell [but I'm no expert], you don't need to hook anything to do this.
You simply just monitor the printer job queue using FindFirstPrinterChangeNotification/FindNextPrinterChangeNotification and then catch any PRINTER_CHANGE_ADD_JOB|PRINTER_CHANGE_WRITE_JOB calls. As far as editing what's to be printing goes?
If I was in your shoes and wanted a simple solution, I'd cancel the current job and just create another one with your data. It seems to be a bit of a hassle to grab what's about to be printed and then modify it.
awesome
never heard about that api b4.
btw is there a way to know or enumerate all the jobs id's that the printer is holding at the moment?
my goal is to cancel the printing process when my process detects that a new job is sent to the printer. _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum