question

ToddChester-3826 avatar image
0 Votes"
ToddChester-3826 asked ToddChester-3826 answered

List of printers? Registyry or API call?

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,
-T

windows-server-print
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CarlFan-MSFT avatar image
0 Votes"
CarlFan-MSFT answered

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://docs.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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ToddChester-3826 avatar image
0 Votes"
ToddChester-3826 answered

How do I do this WITHOUT .net?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CarlFan-MSFT avatar image
0 Votes"
CarlFan-MSFT answered

Hi,
Thank you for your update.
I consider that you could use wmi command to get the information.
https://docs.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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ToddChester-3826 avatar image
0 Votes"
ToddChester-3826 answered

Hi Carl,

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

-T

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.