BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Printer hook

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Bogdan
Guest





PostPosted: Wed Feb 08, 2006 11:05 pm    Post subject: Printer hook Reply with quote



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





PostPosted: Thu Feb 09, 2006 12:05 am    Post subject: Re: Printer hook Reply with quote



"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.