Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

win32 print queue

Thread view: 
linuxnooby@yahoo.com.au - 09 Apr 2006 03:55 GMT
Hi

Is it possible to control a windows XP/2000 print queue using java?

What I want to do is have java dialogue box appear when the user prints
from any application (web browser , Word etc). The dialogue box would
say "this is 3 pages it will cost 60 cents, do you want to proceed?" If
the user clicks OK then the print job runs, otherwise print job is
deleted. Is there a way for Java to pause the print queue and then be
able to release particular print jobs?

cheers Dave
Chris Uppal - 09 Apr 2006 08:17 GMT
> Is it possible to control a windows XP/2000 print queue using java?

No.

(And doing what you want, even in Windows-specific C++ code, would require deep
magic...)

   -- chris
Lee Peedin - 09 Apr 2006 15:42 GMT
>> Is it possible to control a windows XP/2000 print queue using java?
>
[quoted text clipped - 4 lines]
>
>    -- chris

Chris,
Monitoring the Windows print queue would in no way require "deep
magic"" C++ code.  It can be done very easily with any scripting
language that supports ActiveX/OLE.  Simpy create a WMI query that
monitors the print queue.  This can be done in VBScript, ooRexx, etc.
And is probably directly available in Java using SWT since SWT
provides an ActiveX class.

I have dozens of applications that run unattended that create PDF
documents of client collected data.  Upon completion, these documents
are emailed to the client.  One can not assume that the PDF completion
is finished simply because the application has finished, so it becomes
necessary to monitor the print queue to determine when to specific
document has left the queue.  In the OP's case, this "monitoring"
could also remove the document from the queue should the user decide
the "price is too high".

Since this is somewhat off-topic of this NG, anyone is welcomed to
email me directly for sample ooRexx code to monitor the print queue.

Lee
Roedy Green - 09 Apr 2006 18:45 GMT
On Sun, 09 Apr 2006 14:42:18 GMT, Lee Peedin
<lpeedinDONOSPAMME@nc.rr.com> wrote, quoted or indirectly quoted
someone who said :

>Monitoring the Windows print queue would in no way require "deep
>magic"" C++ code.  It can be done very easily with any scripting
>language that supports ActiveX/OLE.  Simpy create a WMI query that
>monitors the print queue.  This can be done in VBScript, ooRexx, etc.
>And is probably directly available in Java using SWT since SWT
>provides an ActiveX class.

see http://mindprod.com/jgloss/com.html for various ways of doing COM
in Java. All are going to do the actual work in C/C++ via JNI.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Chris Uppal - 11 Apr 2006 10:37 GMT
> Monitoring the Windows print queue would in no way require "deep
> magic"" C++ code.  It can be done very easily with any scripting
> language that supports ActiveX/OLE.  Simpy create a WMI query that
> monitors the print queue.

I would call WMI fairly deep myself ;-)  I don't think many people, except
advanced Windows system administrators, even know it exists.  (I played with it
a bit a year or two back and found it very confusing -- the documentation is,
or was then, dire).

Anyway, is it possible to /intercept/ requests to the queue with WMI ?  I had
assumed not[*], and without that ability I don't see how the OP can do what he
wants.  (It's not enough to cancel the request if the user hits "no", but the
request has to be stopped until the user hits "yes".)

   -- chris

[*] Or, to be more honest, I had forgotten about WMI entirely, but I /would/
have assumed that if I'd remembered ;-)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.