This section describes the methods that can be used to install print monitors. (You can install a print monitor with the same INF file that you use to install your printer. For more information about INF files, see Plug and Play and Power Management.)
To install a language monitor, you must list its file name in an INF file by using a LanguageMonitor entry. This entry must be included for every printer driver that controls a printer requiring the use of the language monitor. For more information, see Printer INF Files.
The Add Driver wizard or the Add Printer wizard reads this INF file and installs language monitors associated with printer drivers.
Alternatively, custom installation applications can install language monitors by calling the spooler's AddMonitor function, to explicitly install only a specific monitor DLL.
(The AddMonitor function is described in the Platform SDK documentation.)
To install a port monitor, your installation medium must include a printer INF file (that is, an INF file for which Class = Printer) that contains a PortMonitors section. The single entry in this section points to an install section containing two entries: an INF CopyFiles directive that lists all of the files that make up the port monitor, and a PortMonitorDll entry that specifies which DLL in the previous list implements the port monitor interface. The following example code illustrates these points. The PortMonitors section points to an install section named SamplePortMon. In that section, an INF CopyFiles directive copies three files that make up the port monitor. Following that, a PortMonitorDll entry identifies the DLL that implements the port monitor interface.
[PortMonitors] "Sample Port Monitor" = SamplePortMon [SamplePortMon] CopyFiles = @file1.dll, @file2.dll, @file3.hlp PortMonitorDll = file1.dll
To install a port monitor, open the Printers folder in Control Panel. On the Printers folder's File menu, select Server Properties. On the File Server Properties dialog, click the Ports tab, and then click the Add Port... button. On the Printer Ports dialog, click the New Port Type... button. Type the path to the INF file in the text input box, and then click OK.
Alternatively, a custom installation application can install the port monitor DLL by a call to the AddMonitor function (described in the Platform SDK documentation).