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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

789 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