Six functions provide most of the functionality required for an application that implements printing for Windows version 3.1:
Function | Description |
AbortDoc | Terminates a print job. Supersedes the ABORTDOC printer escape. |
EndDoc | Ends a print job. Supersedes the ENDDOC printer escape. |
EndPage | Ends a page. Supersedes the NEWFRAME printer escape. |
SetAbortProc | Sets the abort function for a print job. Supersedes the SETABORTPROC printer escape. |
StartDoc | Starts a print job. Supersedes the STARTDOC printer escape. |
StartPage | Prepares the printer driver to receive data. Supersedes the NEWFRAME and BANDINFO printer escapes. |
The functions in the preceding list are new for Windows 3.1. Another function, ResetDC, is also new for Windows 3.1. ResetDC updates a device context, allowing an application to change the paper orientation or paper bin within a single print job. This ability was not supported by a printer escape in previous versions of Windows.
The PrintDlg function displays a Print dialog box or a Print Setup dialog box. These dialog boxes are two of the common dialog boxes that are new for Windows 3.1. The Print dialog box makes it possible for the user to specify the properties of a particular print job. The Print Setup dialog box makes it possible for the user to select additional job properties and configure the printer.
With previous versions of Windows, applications used printer escapes to communicate with the device driver associated with the printer. Most applications no longer need to use printer escapes. Support for escapes is still provided, however, for backward compatibility with previous versions of Windows and because in some cases (for example, complex graphics data on PostScript printers) printer escapes offer functionality that the functions do not. Applications should use the new printer functions whenever possible, to maximize their compatibility with future Windows versions.
For information about printer escapes, see the Microsoft Windows Programmer's Reference, Volume 3.