1
votes

In the windows -> printers and devices -> actual print queue there is (the last) column called Port like here

When printer pooling is enabled, this shows the port name (for the real printer) the document is printing like first c:\ports\p1, second c:\ports\p2 (or port_2121 and port_2122 ... etc). I want to get the same information.

I checked Enumjobs , and JOB_INFO_1 - 4 structure, non of them has a port or portname member. I tested, and pPrinterName is always the same too. So not even from that side it is accessible.

Any idea how could I get the port where the job is printing ? (like the print queue does)

Thx

1

1 Answers

1
votes

You can do that using FindNextPrinterChangeNotification function with JOB_NOTIFY_FIELD_PORT_NAME field. This value can be changed when printer pooling is enabled and one port is buzy