Using EnumPrinters

This sample shows a very simple console program that displays some information about the local printers installed on the local system. For this, it uses the EnumPrinters() API in level 2, which returns the printers information in a PRINTER_INFO_2 structure array. Some of the information contained therein is:

  • Server name
  • Printer name
  • Share name (if Applicable)
  • Ports the printer is connected to
  • Driver name
  • Comment and location provided by the admin
  • Under Win9x, it says if the printer is the default printer for the system

So, without anything else, here it is: enumprint.c

1 comment

  1. Hi, I try your code in my PC.

    And appear the following error:

    …….. has encountered a problem and needs to close. We are sorry for the inconvenience.
    If you were in middle of something, the information you were working on might be lost.

    Please tell Microsoft about this problem.

    We have created an error report that you can send to us. We will treat this report as confidential and anonymous

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>