且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在c ++ / vc ++中找不到为作业打印的页面

更新时间:2023-11-17 11:13:22

您可以订阅Windows打印假脱机程序通知功能,如FindFirstPrinterChangeNotification,FindNextPrinterChangeNotification,感兴趣的是JOB_NOTIFY_FIELD_TOTAL_PAGES,JOB_NOTIFY_FIELD_PAGES_PRINTED。或者,您可以使用Windows XP上的OpenEventLog或Vista及更高版本上的EvtSubscribe检查Windows日志中的相同信息。你可以从印刷过程中完成。
You can subscribe to Windows print spooler notification functions, as FindFirstPrinterChangeNotification, FindNextPrinterChangeNotification with interest of JOB_NOTIFY_FIELD_TOTAL_PAGES, JOB_NOTIFY_FIELD_PAGES_PRINTED. Or you can examine Windows logs for the same information, using OpenEventLog on Windows XP or EvtSubscribe on Vista and later. And you can do it from printing process.