List of printers? Registyry or API call?

Todd Chester 646 Reputation points
2021-06-29T06:27:33.537+00:00

Hi All,

When a program gets a list of printers on the system to print to, is the list coming from a registry read or from an API call? If the registry, where? Is an API call, which one?

Many thanks,

Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
641 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Carl Fan 6,836 Reputation points
    2021-06-30T09:37:27.733+00:00

    Hi,
    The code in the program obtains printer information by calling the API interface of printer property.
    Just like the information below: System.Drawing.Printing.PrinterSettings
    https://learn.microsoft.com/en-us/dotnet/api/system.drawing.printing.printersettings.installedprinters?redirectedfrom=MSDN&view=net-5.0#System_Drawing_Printing_PrinterSettings_InstalledPrinters
    Hope this helps and please help to accept as Answer if the response is useful.
    Best Regards,
    Carl

    0 comments No comments

  2. Todd Chester 646 Reputation points
    2021-06-30T16:11:21.593+00:00

    How do I do this WITHOUT .net?

    0 comments No comments

  3. Carl Fan 6,836 Reputation points
    2021-07-05T10:24:32.917+00:00

    Hi,
    Thank you for your update.
    I consider that you could use wmi command to get the information.
    https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printer
    Hope this helps and please help to accept as Answer if the response is useful.
    Best Regards,
    Carl

    0 comments No comments

  4. Todd Chester 646 Reputation points
    2021-07-05T23:06:30.963+00:00

    Hi Carl,

    Way, way too complicated. I only want the printer's name. Port would be nice, but I can live without it.

    -T

    0 comments No comments