Printer Jobs:

On occassion I have wanted to know the status of a print job. Also one customer asked me for code to set a print job to the least busy printer and notify the user when the print job was done.  Since CW lets you set the document or job name in the report formater, you can use this code to track when the job is done.  There is much more info in the Job_Info_2 structure than shown in case you need it.  All I was interested in was getting the job name and status string. When the job name is no longer in the job queue the job is done.  There is no way to tell if the job was deleted or printed sucessufully.  All you know is it is done.

Also included is code to get/set the default printer in windows.

There is code included for enumerating printers and sending a file, block of text to a printer.  That portion of the code is a subset of some 2.003 code called prtlib.zip that is also uploaded on Icetips somewhere.  If that is what you need to do, look at that upload.

Depending on how you call enumjobs() it will either popup a dialog to allow picking a printer or let you specify a printer, or if the popdlg flag=0 and the printer name is blank, it uses the default printer.

Hope it helps,
Jim Kane
Productive Software Solutions
jkane@compuserve.com

