206. PrnInfo
- For years, I've seen newsgroup posts asking how to obtain more information about print queues, spooler status, print job information, and so on. This sample tries to incorporate nearly all of these tasks into a neat little package. You'll have drop-in ready classes that replicate PRINTER_INFO_4 structures, DEVMODE structures, JOB_INFO_2 structures, and a lot more. Want to enumerate print jobs? Adjust a job's position in the queue? Receive notification when a print queue is changed? Pause, resume, or purge a print queue? Get or set the default printer in any operating system? This demo has methods for those, and much, much more!
Some of the demonstrated APIs include: GetPrinter, SetPrinter, EnumPrinters, EnumJobs, GetJob, SetJob, GetDefaultPrinter, SetDefaultPrinter, PrinterProperties, and many more.
这些年来,我看到新闻组上经常询问如何获得有关打印队列、缓存池状态、打印队列,等等的信息。这个例子试图将所有的任务集中在一个中包中。你可以有方便使用的类来复制PRINTER_INFO_4、DEVMODE 、JOB_INFO_2 等结构。想列举打印队列吗?调整一个工作在队列中的位置吗?当打印队列改变时收到通知吗?暂停、恢复或清空打印队列吗?在任何操作系统中得到或设置缺省的打印机吗?这个例子演示了所有这些功能,或者更多!
演示的一些API包括:GetPrinter, SetPrinter, EnumPrinters, EnumJobs, GetJob, SetJob, GetDefaultPrinter, SetDefaultPrinter, PrinterProperties,等等。
来源: http://www.mvps.org/vb/ |