In the print spooler dialog for any installed printer, there is a menu option to use the printer offline. Enabling this option means that all documents will be queued until the said printer comes online.
The option I'm talking about:
I do not want this for my application which interacts with a printer. This is because I need to tell the user (it's a requirement) when the printer is not connected. I'm using the GetPrinter
function with the PRINTER_INFO_2
structure to check for the PRINTER_ATTRIBUTE_WORK_OFFLINE
attribute.
When I manually disable the aforementioned option, my GetPrinter
method tells me that the printer is offline when it is not connected and online when it is. When I leave that option enabled, the GetPrinter
method always tells me that the printer is online (which I understand).
How do I disable the "Use Printer Offline" option programmatically?