|
-
Jan 5th, 2005, 01:23 PM
#1
Thread Starter
Hyperactive Member
How to check if a printer is still printing docs?
Hello Everybody,
Can you tell me if there is a way (maybe API) to check if there are documents waiting to be print on a printer?
I want my app to continue running only after the printer will finish printing all the documents.
Thank you all in advance'
ERAN
Eran Fox
ASSEMBLER,C,C++,VB6,SQL...
-
Jan 5th, 2005, 01:28 PM
#2
Re: How to check if a printer is still printing docs?
Visit Karl's site and download his PrnInfo.zip sample project.
-
Jan 5th, 2005, 03:17 PM
#3
Thread Starter
Hyperactive Member
Re: How to check if a printer is still printing docs?
Reply to RhinoBull,
Hello RhinoBull and thank you for your reply!
I will check Karl's code tommorw morning.
I think i found what i was looking for at:
http://www.vbcity.com/forums/topic.asp?tid=60884
a code by loco_42
VB Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
If wordApp.Options.PrintBackground = True Then
While wordApp.BackgroundPrintingStatus > 0
DoEvents
Sleep (5000)
Wend
End If
i will have to test this code tommorow morninig as well.
Again thank you for your reply,
i will send the results of my testings to the forum/
Eran Fox
ASSEMBLER,C,C++,VB6,SQL...
-
Jan 5th, 2005, 03:22 PM
#4
Re: How to check if a printer is still printing docs?
Perhaps it is what you were looking for but it won't give you complete status of your printer (it's just checking on some word document if it's still printing) and that could be a huge problem. Problem that you may encounter is that this particular print job can be sitting in the queue for a long time until it happens so your program will be looping and looping and ....
Karl's sample project is one of the best I've ever seen.
Last edited by RhinoBull; Jan 5th, 2005 at 03:26 PM.
-
Jan 5th, 2005, 03:38 PM
#5
Thread Starter
Hyperactive Member
Re: How to check if a printer is still printing docs?
Hello RhinoBull,
I think you are right.
But i'm using a virtual printer , and my app will have to wait (and wait and wait...) till the printer will finish printing.
as i said,i will test both codes and will let you know what did i do.
Again thank you for your fast reply!
ERAN
Eran Fox
ASSEMBLER,C,C++,VB6,SQL...
-
Jan 5th, 2005, 05:10 PM
#6
Re: How to check if a printer is still printing docs?
-
Jan 5th, 2005, 10:44 PM
#7
Re: How to check if a printer is still printing docs?
I may use that code, as it looks slick. It's not a problem, but users have a habit of clicking on the print button a second time if they don't hear the printer start immediately.
Last edited by dglienna; Jan 5th, 2005 at 10:54 PM.
-
Jan 5th, 2005, 10:54 PM
#8
Re: How to check if a printer is still printing docs?
Sorry, but I don't find it "slick" - if you want to loop till something happend use timer ... At least you wouldn't have to suspend execution so you can do something else simultaneously.
-
Jan 5th, 2005, 10:57 PM
#9
Re: How to check if a printer is still printing docs?
I meant the article using WaitforSingleProcess API. Anything wrong with that?
-
Jan 5th, 2005, 11:02 PM
#10
Re: How to check if a printer is still printing docs?
Oh no ... I thought you were referring to this:
While wordApp.BackgroundPrintingStatus > 0 ... Bad me!
That is a good article, also take a look at the link to Karl E. Peterson's site I've provided earlier in the thread.
Sorry.
-
Jan 6th, 2005, 09:02 AM
#11
Thread Starter
Hyperactive Member
Re: How to check if a printer is still printing docs?
Reply to ALL,
Thank you guys'
I'm Sorry,I just didnt have the time to check out the code and articles yet.
I promise , answers will be send soon!!!
ERAN
Eran Fox
ASSEMBLER,C,C++,VB6,SQL...
-
Jan 6th, 2005, 01:10 PM
#12
Re: How to check if a printer is still printing docs?
Karl's code does more than I need, so I think I'll pass on it. Also, it reported a print job in the fax queue that I killed that didn't report the change. Also, reported the printer as being paused, which it couldn't un-pause. When I tried to delete the fax, it produced an error.
-
Jan 6th, 2005, 01:36 PM
#13
Re: How to check if a printer is still printing docs?
Ouch. The only way that I can see it working is to keep waiting for pinter notifications. Not what I wanted to do. Plus, I had a problem with duplicate names when I tried to copy/paste his work. There is no project to download.
It seemed like a good idea, but is probably not worth the effort, unless someone wants to put together a project that waits only for printer to print or crash, and then exit.
-
Jan 11th, 2005, 02:10 PM
#14
Thread Starter
Hyperactive Member
Re: How to check if a printer is still printing docs?
Reply to All,
Hi Guys,
As i said before...
I tested Karl's code and it was great but i had to change few things in my code and now my app is working just fine with the printer.
Thanks a lot RhinoBull - now i know of another source site.
also thanks to Merrion and dglienna
Best Regards,
ERAN
Eran Fox
ASSEMBLER,C,C++,VB6,SQL...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|