Announcement

Collapse
No announcement yet.

Windows Spooler progress window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Windows Spooler progress window

    What is the call to bring up a named printer's Document queque? I'm talking about the same window that comes up when you double click the printer icon.

    Bob Mechler

  • #2
    From my CD version of SDK, I found this page...

    Printing and Print Spooler Functions
    ...
    The following functions are used to access the print spooler
    ...
    EnumJobs Retrieves information about a specified set of print jobs for a specified printer.

    I got to this page by selecting "OpenPrinter" function which provides a link to "Printing and Spooler Functions" which is the page cited here.

    You should be able to follow the same route in your SDK reference or at the MSDN on-line SDK.

    But just for the heck of it, let's drill down into EnumJObs and see if anything interesting appears...


    Well, yes, the JOB_INFO_1 structure ....
    Code:
    typedef struct _JOB_INFO_1 { 
      DWORD  JobId; 
      LPTSTR pPrinterName; 
      LPTSTR pMachineName; 
      LPTSTR pUserName; 
      LPTSTR pDocument; 
      LPTSTR pDatatype; 
      LPTSTR pStatus; 
      DWORD  Status; 
      DWORD  Priority; 
      DWORD  Position; 
      DWORD  TotalPages; 
      DWORD  PagesPrinted; 
      SYSTEMTIME Submitted; 
    } JOB_INFO_1, *PJOB_INFO_1;
    ... includes a Status member... codes are:

    Specifies the job status. This member can be one or more of the following values. Value Meaning
    • JOB_STATUS_BLOCKED_DEVQ The driver cannot print the job.
    • JOB_STATUS_COMPLETE Windows XP: Job is sent to the printer, but the job may not be printed yet. See Remarks for more information.
    • JOB_STATUS_DELETED Job has been deleted.
    • JOB_STATUS_DELETING Job is being deleted.
    • JOB_STATUS_ERROR An error is associated with the job.
    • JOB_STATUS_OFFLINE Printer is offline.
    • JOB_STATUS_PAPEROUT Printer is out of paper.
    • JOB_STATUS_PAUSED Job is paused.
    • JOB_STATUS_PRINTED Job has printed.
    • JOB_STATUS_PRINTING Job is printing.
    • JOB_STATUS_RESTART Job has been restarted.
    • JOB_STATUS_SPOOLING Job is spooling.
    • JOB_STATUS_USER_INTERVENTION Printer has an error that requires the user to do something.
    I would think by keying on the printer name member during the enumeration you could develop a list of all the documents for a printer, with each job's status... which sounds a lot like what you see on the "open printer" screen....

    Sure looks like a start, anyway...

    MCM
    Last edited by Michael Mattias; 18 Jan 2008, 09:00 AM.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Lee Bergeron provided a nice function that does return how many jobs are in the queque for a specified printer. The pages_printed and total pages would also be something to add.

      I could just tell the user to double-click the printer to get a pop-up but it would be better to display a smaller centered window that updates several facts about the print job that the current program is working on. Both Ddoc and XPRINT have the ability to assign a job name. Now that I've got a few clues, I'll just go ahead with my own. If I come up with anything of general benefit, I'll post it.

      Bob Mechler

      Comment

      Working...
      X