• list of printers?

    From T@21:1/5 to All on Sun Jun 27 23:03:29 2021
    Hi All,

    Is there a system call that will return a list
    of all the printers or should I just read the
    registry?

    Many thanks,
    -T

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to All on Mon Jun 28 18:26:46 2021
    On Sun, 27 Jun 2021 23:03:29 -0700, T wrote:
    Hi All,

    Is there a system call that will return a list
    of all the printers or should I just read the
    registry?

    Many thanks,
    -T

    Printer API has it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From T@21:1/5 to All on Mon Jun 28 08:15:27 2021
    On 6/28/21 4:26 AM, JJ wrote:
    On Sun, 27 Jun 2021 23:03:29 -0700, T wrote:
    Hi All,

    Is there a system call that will return a list
    of all the printers or should I just read the
    registry?

    Many thanks,
    -T

    Printer API has it.


    This one?

    https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From T@21:1/5 to R.Wieser on Mon Jun 28 14:01:19 2021
    On 6/28/21 1:22 PM, R.Wieser wrote:
    T,

    This one?

    https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters

    Thats one of them. It could not hurt to take a peek at the other functions in that group ("see also", "Print Spooler API Functions") though.

    Depending on what exactly you are looking for - all currently usable printers, or just a list of possible ones (with drivers installed for them) or something other - the function(s) you need might differ.

    Regards,
    Rudy Wieser



    Hi Rudy,

    Under Windows 10, I have found the Devices and Printers
    does not always list all the printers -- very frustrating
    at times.

    I find the missing printers by going into any program
    with a print dialog and finding them in the pull down.

    So I wanted to write a program that would give me a
    quick list of printers, so I can see what is missing
    from Devices and Printers.

    This is what I wrote for Linux:

    $ ListPrinters.pl6
    nCount <5>
    $i = <0> printer: <B4350>
    $i = <1> printer: <Cups-PDF>
    $i = <2> printer: <Cups_PDF_rn6>
    $i = <3> printer: <Oki_B4350_on_dev_lp0_rn6>
    $i = <4> printer: <Virtual_PDF_Printer>

    I wanted to add an OS check to the above program
    so it would give me Windows as well as Linux
    printers.

    -T

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Mon Jun 28 22:22:31 2021
    T,

    This one?

    https://docs.microsoft.com/en-us/windows/win32/printdocs/enumprinters

    Thats one of them. It could not hurt to take a peek at the other functions
    in that group ("see also", "Print Spooler API Functions") though.

    Depending on what exactly you are looking for - all currently usable
    printers, or just a list of possible ones (with drivers installed for them)
    or something other - the function(s) you need might differ.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Tue Jun 29 10:14:05 2021
    T,

    Under Windows 10, I have found the Devices and Printers
    does not always list all the printers -- very frustrating
    at times.

    I find the missing printers by going into any program
    with a print dialog and finding them in the pull down.

    Thats pretty-much what I'm talking about : the first might be showing the physical printers you can actually print to and the second a list of
    /possible/ printers.

    Alas, I've got no idea which of the functions returns which group though.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From T@21:1/5 to R.Wieser on Tue Jun 29 01:54:22 2021
    On 6/29/21 1:14 AM, R.Wieser wrote:
    T,

    Under Windows 10, I have found the Devices and Printers
    does not always list all the printers -- very frustrating
    at times.

    I find the missing printers by going into any program
    with a print dialog and finding them in the pull down.

    Thats pretty-much what I'm talking about : the first might be showing the physical printers you can actually print to and the second a list of /possible/ printers.

    Alas, I've got no idea which of the functions returns which group though.

    Regards,
    Rudy Wieser



    but, but, but ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Tue Jun 29 15:04:32 2021
    T,

    but, but, but ...

    :-)

    Something I would try is to see if I could, from such "any program with a
    print dialog" list all the functions from DLLs it uses, filter out the ones
    in the "spool" DLL, and see if I could figure out which one is the dialog showing those "missing printers" - and from there see if MSDN has some more info on what it actually does (where it gets it printers from).

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to All on Wed Jun 30 04:07:56 2021
    On Mon, 28 Jun 2021 14:01:19 -0700, T wrote:

    I wanted to add an OS check to the above program
    so it would give me Windows as well as Linux
    printers.

    Linux printers must be made recognizable and accessible by Windows systems
    from the Linux itself, either as SMB shares, UPnP devices, or Internet Printers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From T@21:1/5 to All on Tue Jun 29 15:00:48 2021
    On 6/29/21 2:07 PM, JJ wrote:
    On Mon, 28 Jun 2021 14:01:19 -0700, T wrote:

    I wanted to add an OS check to the above program
    so it would give me Windows as well as Linux
    printers.

    Linux printers must be made recognizable and accessible by Windows systems from the Linux itself, either as SMB shares, UPnP devices, or Internet Printers.


    CUPS (Common Unix Printing System) is pretty good
    at find everything, including your surroundings.

    Now I want to add Windows support to my program
    as well

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Jun 30 14:09:42 2021
    T,

    Found it!

    https://docs.microsoft.com/en-us/dotnet/api/system.drawing.printing.printersettings.installedprinters?redirectedfrom=MSDN&view=net-5.0#System_Drawing_Printing_PrinterSettings_InstalledPrinters

    I hope you do realize that is .NET specific/dependant ...

    I'm fairly sure you can get the same results using the "spool" group of (simple) functions though.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From T@21:1/5 to All on Wed Jun 30 04:38:45 2021
    On 6/27/21 11:03 PM, T wrote:
    Hi All,

    Is there a system call that will return a list
    of all the printers or should I just read the
    registry?

    Many thanks,
    -T

    Found it!

    https://docs.microsoft.com/en-us/dotnet/api/system.drawing.printing.printersettings.installedprinters?redirectedfrom=MSDN&view=net-5.0#System_Drawing_Printing_PrinterSettings_InstalledPrinters

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From T@21:1/5 to R.Wieser on Wed Jun 30 09:12:05 2021
    On 6/30/21 5:09 AM, R.Wieser wrote:
    T,

    Found it!

    https://docs.microsoft.com/en-us/dotnet/api/system.drawing.printing.printersettings.installedprinters?redirectedfrom=MSDN&view=net-5.0#System_Drawing_Printing_PrinterSettings_InstalledPrinters

    I hope you do realize that is .NET specific/dependant ...

    I'm fairly sure you can get the same results using the "spool" group of (simple) functions though.

    Regards,
    Rudy Wieser



    Missed that. Damn.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)