Hi~,

I'm newbie in ms-windows and VC programming. :)

I should develop NT service program that prohibit user's printing any
documents.

I tested SetPrinter() and I found a problem.
Using SetPrinter() can't control network printer that attached in
other machine.
('Access denied' error is displayed when calling OpenPrinter() using
DesiredAccess set to PRINTER_ALL_ACCESS)

So I should find another method.
I want to block all printers installed in local machine(local printer
and network printer). But for the network shared printer, another
computer should can print using this network shared printer.
(Only a computer that my program is installed should be influenced by
my program)

Q.1 Can I hook printing event or job or print spooler?
(I think GetJob() also can't filter user's printing job...)

I posted this question to many newsgroups or forums but I didn't get

suitable answer(may be impossible??...)


Now, I'm testing Customized Print Processor using genprint.dll from
ddk.

I built and copy it to C:\WINNT\system32\spool\drivers\w32x86.

And I made its installation program.

int main()
{
...
nResult = GetPrintProcessorDirectory(...,processorPath,...);
_tcscat(processorPath, _T("\\genprint.dll"));

nResult = AddPrintProcessor(
NULL, // server name
NULL, // environment name
processorPath,//processorPath, // path
"My Processor" // ----> what string should I use??
);

}

It returns error string("The specified module could not be found.").

Q.2 Which string should I use in pPrintProcessorName field? and
processorPath string(C:\WINNT\system32\spool\drivers\w32x86\genprint.dll)
is right?


Q.3 If I success AddPrintProcessor(), how can I change Print Processor
to "My Processor" from "WinPrint" of existing printer?

Q.4 I can't change Print Processor property of network printer
manually(Print Processor button is disabled).
That means, using customized print processor also can't control
printing network printer?


Thanks in advance.

And I hope you can understand my poor english :)

How to install genprint.dll?? by Kiran

Kiran
Wed Oct 22 07:10:34 CDT 2003

First you should copy the genprint.dll to
spool\prtprocs\w32x86 folder and then do AddPrintProcessor
().

Kiran

Re: How to install genprint.dll?? by bdrum992000

bdrum992000
Thu Oct 23 05:25:35 CDT 2003

Thanks a lot.

Now I added genprint PrintProcessor successfully.

But I think, using genprint is not suitable for my purpose.
(I want to block to use of all printers installed in local machine(local printer
and network printer). But for the network shared printer, another
computer should can print using this network shared printer.
(Only a computer that my program is installed should be influenced by
my program)

for network printer attached in other computer,
I can't change its Print Processor to mine manually
in the Property window(the button is disabled...).

Do you have any idea about it?

Thanks.


"Kiran" <anonymous@discussions.microsoft.com> wrote in message news:<051801c39895$7ef72120$a001280a@phx.gbl>...
> First you should copy the genprint.dll to
> spool\prtprocs\w32x86 folder and then do AddPrintProcessor
> ().
>
> Kiran

Re: How to install genprint.dll?? by Ramboi2

Ramboi2
Tue Oct 28 13:52:19 CST 2003

Lee,
I do not think you can tell a network printer to use your local copy of
print-processor. Print-processor usually works together with the driver where
it was installed.

Ramboi2

"Lee, Myoung Ho" <bdrum992000@yahoo.co.kr> wrote in message
news:18adaea1.0310230225.612e6723@posting.google.com...
> Thanks a lot.
>
> Now I added genprint PrintProcessor successfully.
>
> But I think, using genprint is not suitable for my purpose.
> (I want to block to use of all printers installed in local machine(local
printer
> and network printer). But for the network shared printer, another
> computer should can print using this network shared printer.
> (Only a computer that my program is installed should be influenced by
> my program)
>
> for network printer attached in other computer,
> I can't change its Print Processor to mine manually
> in the Property window(the button is disabled...).
>
> Do you have any idea about it?
>
> Thanks.
>
>
> "Kiran" <anonymous@discussions.microsoft.com> wrote in message
news:<051801c39895$7ef72120$a001280a@phx.gbl>...
> > First you should copy the genprint.dll to
> > spool\prtprocs\w32x86 folder and then do AddPrintProcessor
> > ().
> >
> > Kiran