0
Answer

use winspool.drv

Ask a question
sergioss1

sergioss1

19y
5.7k
1
hello everybody, in first time sorry about my english. I'm doing an application that must to count the number of pages people prints in the printer installed in the server. This application will run in a windows server 2003. since now, I've been using Active Directory (IADsPrintQueueOperations, IADsPrintJob,etc) to pause, resume and cancel the document from the print queue and to read the number of pages of the document. the problem arrives when somebody print some copies of a word pad or pdf or Internet Explorer document. When this happens, the program only count the first copy, but allow to print all the copies. I've been reading and I've found that I have to use the API "winspool.drv" with the functions EnumJobs or GetJob but I don't know how to use it and I've not found any example in c# (only in visual basic or c++, and i don't know). Someone can help me? thanks