Compartilhar via


Printer Driver Registry Settings (Compact 2013)

3/26/2014

This topic contains information on the following settings:

  • Global printer
  • Printer driver
  • USB printer class driver registry
  • Serial port
  • 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 key example 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"="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, 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. Printers with USB ports dynamically add and remove themselves from this list when their drivers load and unload.

The name NET0 is reserved for network printing, although the device file name index can be any valid value.

For a printer such as a 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 it is displayed to users. The default printer driver, PCL Laser, is the name of a subkey within HKEY_LOCAL_MACHINE\Printers, where Windows Embedded Compact 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 can 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 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 registry key 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 load an installable printer driver that interacts with the USB driver to perform transfers over the USB port. 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"

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

Network Settings

You will need the Redir module to redirect printing over a network connection.

See Also

Reference

Printer Driver Reference