PDA

Click to See Complete Forum and Search --> : SetPrinter API


Endil
Aug 23rd, 2000, 02:27 AM
Please, does anyone know how the SetPrinter API is used on Win NT ? i got it to work on Win 95, but it still gives me a PRINTER_ACCESS_DENIED Error on Win NT, even when i am logged in as Admin, and the PRINTER_ALL_ACCESS Flag in the OpenPrinter API is set.

gfrench
Aug 24th, 2000, 05:41 PM
I may be able to help you, in what context are you using the setprinter call?

Grant French
-----------------------------------------------
E-Mail: grant.french@libertysurf.co.uk
ICQ: 33122184

Endil
Aug 25th, 2000, 04:54 AM
Thanks a lot for your fast willing to help, i found the solution by chance:

I have to stop several Printers on a NT System for a user defined time. I wanted to do that with the GetPrinter/Setprinter API.

I used openprinter with PRINTER_ALL_ACCESS
and then Getprinter twice, but my fault was that i forgot
to use the CopyMemory Function with the DevMode Struct and call the DocumentProperties Function. After i did this
the program works properly on NT.





Thanks anyway for a fast reply here