Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

winspool.h and Print Queue / Job Watching

Posted on 2002-04-18
9
Medium Priority
?
1,018 Views
Last Modified: 2012-05-05
Okay I have created a Program that receives printer notifications.

So far I can tell when a Print Job is added to the Print Queue and retreive the Job Name, Document Name and User who sent the job to print.
   This is great HOWEVER - How can I tell when:
A.) A job has completed printing and been removed from the queue and which job that was.
B.) A Job has been deleted from the queue by another user - i.e. it never gets printed - and which job that was.


So far my program works like this.

OpenPrinter()
FindFirstPrinterChangeNotification()
...Wait for Notification...
 FindNextPrinterChangeNotification()
 if(PRINTER_CHANGE_ADD_JOB)
 {
  GetJob()
  ...Print Job Info to the Screen...
 }
FreePrinterNotifyInfo(pNotifyInfo);
FindClosePrinterChangeNotification(hPrinterEvent);
ClosePrinter(hPrinter);

For Source code see http://www.dynamic-server.net/pqwatch.zip

Thanks

Adam Retter
adam@cosmic.org.uk
0
Comment
Question by:adamretter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 1000 total points
ID: 6951009
Have you seen http://support.microsoft.com/default.aspx?scid=kb;EN-US;q160129 ("HOWTO: Get the Status of a Printer and a Print Job (Q160129)")? This should anser your question (even though it means "polling" the status)
0
 

Author Comment

by:adamretter
ID: 6951458
How fequently should I poll using EnumJobs to make sure that I capture all Jobs, but not so frequently that it ties the system down?

0
 
LVL 86

Expert Comment

by:jkr
ID: 6951465
Good question - that will depend on the system and its performance. As a rule of thumb, I'd use an interval that is about half the time (or slightly less) the printer needs to produce a page...

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 86

Expert Comment

by:jkr
ID: 6954305
Hmm, did you have a chance to try it?
0
 

Author Comment

by:adamretter
ID: 6954406
Thanks, Yup am working on it at the moment.

An interval of higher than about 100ms and you seem to drop job's.

Will let you know how i get on...
0
 
LVL 86

Expert Comment

by:jkr
ID: 6987030
Anything new on this one? :o)
0
 
LVL 11

Expert Comment

by:griessh
ID: 7012656
Dear adamretter

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "jkr"

comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: http://www.experts-exchange.com/commspt/

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7027916
Force accepted

** Mindphaser - Community Support Moderator **
0
 

Author Comment

by:adamretter
ID: 7753035
Okay hope to post some more info soon
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question