Search code examples
c#printingdetectionpause

C# - Detect if "Pause Printing" option in Print Queue is checked


I am currently looking for a way to detect if the "Pause Printing" option in the "See What's Printing" window is checked.

I've searched high and low, and looked into the Win32 native printing API (winspool) to see if there was such a detection available, but to no avail.

Is there anyone who has experience with a successful implementation of this detection?


Solution

  • For those who are interested:

    Using GetPrinter with level 2, then the filled PRINTER_INFO_2 struct contains a member Status which should have set the bit PRINTER_STATUS_PAUSED.

    Relevant MSDN Articles:
    Documents and Printing > Print Spooler API > Print Spooler API Reference > Print Spooler API Functions > GetPrinter

    This will help you build your enum for PRINTER_ATTRIBUTES and PRINTER_STATUS:
    https://msdn.microsoft.com/en-us/library/cc244854.aspx

    This will help you build the structure for PRINTER_INFO_2:
    https://msdn.microsoft.com/en-us/library/windows/desktop/dd162845(v=vs.85).aspx