>> 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 ;-)