Printer Driver Registry Settings

This topic contains information on the following settings:

  • Global printer
  • Printer driver
  • USB printer class driver registry
  • Parallel port
  • Serial port
  • IrDA
  • Network

Global Printer Settings

The global printer settings that are stored in the registry list the I/O ports to use for printing, provide a global time-out value, and store which printer driver currently is selected as the default. The default printer driver is stored as a value for DefaultPrinter. The printer ports are stored as values in the Ports subkey.

The following registry entry defines five printer ports, two time-out values, and the default printer driver.

[HKEY_LOCAL_MACHINE\Printers\Ports]
    "Port1"="COM1: 9600"
    "Port2"="COM1: 57600"
    "Port3"="IRDA"
    "Port4"="NET0:"
[HKEY_LOCAL_MACHINE\Printers\Settings]
    "TimeOut"=dword:1E
[HKEY_LOCAL_MACHINE\PrintSettings]
    "TimeOut"=dword:2D
[HKEY_LOCAL_MACHINE\Printers]
    "DefaultPrinter"="PCL Laser"

The values correspond to serial ports at 9,600 baud and 57,600 baud, an infrared (IR) port, and a network printer port. For the two COM ports, a baud is also specified. The port monitor parses the values to extract the baud and device file name. Parallel and USB based printers dynamically add and remove themselves from this list as their drivers are loaded and unloaded.

The new file name, IRDA, is reserved for the IR port, whereas COM3: is used for an additional serial port. When assigning an IR port for printing, the value of the key for the port must be the literal string "IRDA" even though this value is not in the standard format for special device file names.

The names LPT1: and NET0: are reserved for parallel and network printing, respectively, although the device file name indexes in those names can be any valid value. For more information, see Device File Names.

For a printer that does not use the parallel port, such as an IR or serial printer, it is difficult to determine whether the printer has received all the data to be printed. Therefore, a time-out parameter is used to detect and report printing errors if the printer fails to give any signal that it is still active. This time-out value is stored in the HKEY_LOCAL_MACHINE\PrintSettings\TimeOut key. The default value is 45 seconds. After the time-out period, the printer driver can display a dialog box to give the user the option to retry or cancel.

The value stored in the DefaultPrinter key lists the printer that is preselected in the common Print dialog box, when is displayed to users. The default printer driver, PCL Laser, is the name of a subkey within HKEY_LOCAL_MACHINE\Printers, where Windows CE can find settings for the PCL laser printer driver.

Printer Driver Settings

Settings for individual printer drivers are stored in subkeys of the HKEY_LOCAL_MACHINE\Printers key. The following table shows the registry subkeys that a printer driver should define.

Subkey Description
Driver Names the DLL that contains the printer driver.
High Quality Stores the resolution of high-quality mode. This key must always be present.
Draft Quality Stores the resolution of draft-quality mode. Not all printers support a draft-quality mode, so this key may be omitted.
Color Defines whether a printer can print in color or only in monochrome.

If color is supported, this key must be set to the literal string "Color" so that the common Print dialog box enables color printing for applications.

These printer driver settings are actually used by the Page Setup dialog box, which is shared by all applications. Printer drivers do not need to read these values from the registry; the appropriate values will be passed to the printer driver in a device capabilities structure.

The following example shows settings for the PCL laser printer driver and the PCL Inkjet printer driver.

[HKEY_LOCAL_MACHINE\Printers\PCL Laser]
    "Driver"="pcl.DLL"
    "High Quality"="300"
    "Draft Quality"="150"
    "Color"="Monochrome"
    "Version"="0x200"
[HKEY_LOCAL_MACHINE\Printers\MaxAll Test Color Printer]
   "Driver"="pcl.dll"
    "High Quality"="300"
    "Draft Quality"="75"
    "Color"="Color"

USB Printer Class Driver Registry Settings

USB printer class drivers also load an installable printer driver that interacts with the USB driver to perform transfers over the USB bus. As part of the driver's initialization, it registers the port name to be used under the registry key HKEY_LOCAL_MACHINE\Printers\Ports. This enables the port driver in the common Print dialog box. The sample USB driver registers the port name to be LPT.

[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\Default\Default\7\Printer_Class]
    "DLL"="USBPRN.DLL"
    "Prefix"="LPT"
[HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\Printer_Class]
    "DLL"="USBPRN.DLL"
    "Prefix"="LPT"

Parallel Port Settings

The following registry key example shows the parallel port printer registry settings.

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Parallel]
    "DeviceArrayIndex"=dword:0
    "Prefix"="LPT"
    "Dll"="Parallel.Dll"
    "Order"=dword:0
    "IoBase"=dword:278
    "IoLen"=dword:C
    "DeviceType"=dword:0
    "FriendlyName"=LOC_FRIENDLYNAME_PARALLEL
    "DevConfig"=hex: 10,00, 00,00, 05,00,00,00, 10,01,00,00, 00,4B,00,00, 00,00, 08, 00, 00, 00,00,00,00fids

Serial Port Settings

The following registry key example shows the serial port printer registry settings.

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial]
    "SysIntr"=dword:13
    "IoBase"=dword:02F8
    "IoLen"=dword:8
    "DeviceArrayIndex"=dword:0
    "Prefix"="COM"
    "Dll"="Com16550.Dll"
    "Order"=dword:0
    "Priority"=dword:0

IrDA Settings

IrDA is implemented using a serial port interface. It creates a virtual COM port interface for which the settings will be similar to a built-in serial driver, as shown in the Serial Port Settings example.

Network Settings

You will need the redir module to redirect printing over network connection. For more information, see redir Module.

See Also

Printer Drivers | Printer Driver Samples

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.