Hello all,


I want to intercept all the print jobs sent to a printer and pop up a dialog
to ask user for confirmation (telling him page count, price, etc.)

I searched on previous posts in the newsgroups and I think that the better
solution was to implement a print-monitor.

So now I've implemented a print monitor DLL (ConfirmMonitor.dll) that
supporta a new kind of port that is redirected to another existing port. The
target .DLL is loaded and initialized by my .DLL. Basically, all the calls
are forwarder to the target monitor .DLL, except StartDocPort(). When
StartDocPort is called in my DLL it pops up the confirmation dialog, if user
cancels then StartDocPort returns FALSE, ...

It works fine when target ports are local (LPT1:, nul:, pdf...).

But it fails with network ports. In this case, I can send the print job, it
arrives to the print server and it's shown in the queue, but it is NOT
printed.
- Then if I stop spooler in the client, the job is printed in the server and
deleted from the queue.
- If I send a second print-job, the first job is printed and the second
remains in the queue.
- In the print server, the real document name does not appear; instead it
appears as "Remote low level document" (maybe another words, I've translated
from spanish).

The printer driver is the same in both computers.

Any suggestion or idea?

Another solution seems to be by using api hooking...

Anyway I would like to now what's the problem in the print monitor DLL.

Thanks,
David D.