 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Bogdan Guest
|
Posted: Wed Feb 08, 2006 11:05 pm Post subject: Printer hook |
|
|
Is there a way a printer hook can be installed in windows.I need to monitor
the job queue of a specified printer for jobs that match a description,
and log if they printed or not.I can enumerate current jobs, but I think
using a timer or a thread to periodically check the job queue is not very
efficient, because most of the time the queue will be empty.
Thank you.
Bogdan |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Feb 09, 2006 12:05 am Post subject: Re: Printer hook |
|
|
"Bogdan" <boprea (AT) xnet (DOT) ro> wrote in message
news:43ea6f46 (AT) newsgroups (DOT) borland.com...
| Quote: | I need to monitor the job queue of a specified printer
|
Under NT-based systems, you can use FindFirstPrinterChangeNotification(),
FindNextPrinterChangeNotification(), and
FindClosePrinterChangeNotification().
| Quote: | I can enumerate current jobs, but I think using a timer or a thread
to periodically check the job queue is not very efficient, because
most of the time the queue will be empty.
|
By using a thread, you can call FindFirstPrinterChangeNotification() and
then call WaitForSingleObject() in a loop. Each time WaitForSingleObject()
indicates that a change has occured, use FindNextPrinterChangeNotification()
to find out you why the change occured. You can even get printing status.
Refer to MSDN for more details:
FindFirstPrinterChangeNotification
http://msdn.microsoft.com/library/en-us/gdi/prntspol_9sxa.asp
FindNextPrinterChangeNotification
http://msdn.microsoft.com/library/en-us/gdi/prntspol_0tym.asp
FindClosePrinterChangeNotification
http://msdn.microsoft.com/library/en-us/gdi/prntspol_1c1a.asp
Gambit |
|
| Back to top |
|
 |
|
|
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
|
|