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
232 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now