PC_PRINTER_SET_DEFAULT

Sets a process-wide default printer before a printer is opened.

Syntax:

call "PC_PRINTER_SET_DEFAULT" using by value default-option
                              by reference   default-struct
                              returning      status-code

Parameters

default-option
Call prototype (see Key): cblt-x4-comp5
Picture: pic x(4) comp-5.
default-struct
Group predefined as cblt-printer-default containing:
01 cblt-printer-default                typedef.
  03 cblte-pd-printer-name.
    05 cblte-pd-printer-name-length    cblt-x2-comp5.	*> pic x(2) comp-5.
    05 cblte-pd-printer-name           cblt-x1.       *> Occurs depending on
                                                      *> cblte-pd-printer-name-length.
                                                      *> pic x (printer name length)
  03 cblte-pd-printer-browse REDEFINES cblte-pd-printer-name.
    05 cblte-pd-printer-browse-hwnd    cblt-HWND.     *> pic x(4) comp-5.
    05 cblte-pd-printer-browse-namelen cblt-x2-comp5. *> pic x(2) comp-5.
    05 cblte-pd-reserved               cblt-x2-comp5. *> pic x(2) comp-5.
    05 cblte-pd-printer-browse-name    cblt-x1.       *> Occurs depending on
                                                      *> cblte-pd-printer-browse-namelen.
                                                      *> pic x (printer name length)
status-code
See Library Routines - Key.

On Entry:

default-option
Specifies the default option:
1 Sets the default printer to be used
2 Browses for a default printer.
Whendefault-option is set to 1:
printer-name-length
The length of the printer-name
printer-name
The name of the printer
Whendefault-option is set to 2:
browser-hwnd
The handle for the printer browser

On Exit:

When default-option is set to 2:
printer-name-length
The length of the printer-name
printer-name
The name of the printer
reserved
Reserved.
status-code
Printer Handling Routines Return Codes

Comments:

If you set default-option to 2, this function returns the user-selected printer but does not set it as the default printer.

The printer name must be e