Customising the printer dialog box

In this section:

ClearWin+ uses the standard Windows dialog box to interrogate the user, in each of the above approaches. This has the advantage that the style of the box will take on the 'look and feel' of the operating system in use and will be familiar to your users.

Note that by default Windows uses a new Print dialog. The following ClearWin+ function can be called to force the old Print dialog to be used:


Input a value of SET=1 to use the the old dialog. SET=0 restores the default. The function returns the former state of SET.

In order to change the default behaviour of the printer dialog box you can call PRINTER_DIALOG_OPTIONS@ in order to specify the information that is to be requested in the printer dialog box when it opened using PRINTER_OPEN etc. or open_printer@ etc. (also you can obtain the values selected by the user with calls to CLEARWIN_INFO@).

PRINTER_DIALOG_OPTIONS@ takes nine integer arguments referred to as A1 to A9. The following table indicates the changes that are possible:


CLEARWIN_INFO@ parameter for result

Default behaviour


Print to file


Available, initially not checked

If a printer is selected with this option checked, the user will be prompted for a file name. No programming action is required to support this feature. This box will be hidden if A2 is non-zero, and will be initially checked if A9 is non-zero.



Available, initially not checked

This is a radio button which is used to indicate that only selected material is to be printed. It is up to you to read the parameter and act on it as required. This box will be greyed out (not hidden) if A3 is non-zero, and will be initially selected if A6 non-zero.

Page numbers



Available, set to 1,1.

This enables a range of pages to be selected in various ways. The control is disabled if A2 is non-zero. If all pages are selected the range is returned as 1-32767. If A5 is non-zero the range selection option will be initially selected. If A8 is non-zero the all-pages option will be initially selected.




This control is always available. Some printer drivers support this option explicitly and the program is not informed of the selection because no action is required. If the parameter is set, an appropriate response is required from the program. If A7 is non-zero the collate box is initially checked.




This control is always available. Some printer drivers support this option explicitly and the program is not informed of the selection because no action is required. If the number of copies is greater than 1, the program should reproduce the output.

Default warning


Will occur

A warning will be generated if the user has no printer selected as the default. This wil be suppressed if A4 is non-zero.

Also CLEARWIN_INFO@('PRINTER_PAGENUMBERS') returns 1 if the 'Page Range' is set to 'Pages'.

At most one of A5, A6, A8 should be set non-zero, as they select mutually exclusive options. These defaults work for both built in call-backs and explicit routine calls.

Four other CLEARWIN_INFO@ parameters are also used to control the initial appearance of the printer dialog box. These parameters are set using SET_CLEARWIN_INFO@. The parameters are:





In some situations it may be necessary to set these parameters in a multiple call-back, for example:


where set_printer_info is a user-defined function that makes appropriate calls to set_clearwin_info@.



Copyright © 1999-2024 Silverfrost Limited