Solved

How do I control the order of print jobs in the printspooler, or how can I determine when a job is finished to start the next job

Posted on 2003-12-11
3
261 Views
Last Modified: 2010-04-05
WE are trying to print multiple word documents from Windows api through Delphi 5. The problem we have, is we do not know how to access the print job object that tells us when the current print job is finished so that we can close the worddoc object and instantiate the next doc for printing.  The reason we must wait, is because if we fill the print queue in the desired order, it does not necessarily print the documents in that same order.  Any suggestions would be greatly appreciated.

Thanks,
0
Comment
Question by:jreznikoff
[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
3 Comments
 
LVL 5

Accepted Solution

by:
delphized earned 500 total points
ID: 9922376
if it's local and you want a simple solution, then use

procedure WM_SpoolerStatus(var Msg : TWMSPOOLERSTATUS);
      message WM_SPOOLERSTATUS;

...

procedure TFmMain.WM_SpoolerStatus(var Msg : TWMSPOOLERSTATUS);
begin
 memo1.lines.add('Nro '+inttostr(msg.JobsLeft));
  memo1.lines.add('Status '+inttostr(msg.JobStatus));
  msg.Result := 0;
end;

this gives you the number of jobs in the queue.

if you need more precision (enum the print jobs, tell me)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

615 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