Applications should always give the user a chance to cancel a lengthy printing operation. A common way to do this is to display a dialog box when the printing operation begins. During printing, the user can click the dialog's Cancel button to cancel the print operation.
To provide a dialog box that lets the user cancel a printing operation:
1.In your application's resource script (.RC) file, define a modeless AbortDlg dialog box that lets the user cancel a print operation.
2.In your application source code, provide a dialog function to drive the AbortDlg dialog box.
3.In your application source code, provide an Abort function that processes messages for the AbortDlg dialog box.
4.Modify your application's printing procedure so that it displays the AbortDlg dialog box and correctly processes messages.
The sections that follow describe each step in detail.