Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
269 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 2000 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

926 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