This operation code returns additional information about the currently selected printer, extending the functionality of WINPRINT-GET-CURRENT-INFO.
CALL "WIN$PRINTER" USING WINPRINT-GET-CURRENT-INFO-EX, WINPRINT-SELECTION GIVING RESULT
|WINPRINT-SELECTION|| Group item defined in
winprint.def as follows:
01 WINPRINT-SELECTION. 03 WINPRINT-NAME PIC X(80). 03 WINPRINT-PORT PIC X(80). 03 WINPRINT-DRIVER PIC X(80). 03 WINPRINT-DRV-VERSION SIGNED-INT. 03 WINPRINT-NO-OF-PRINTERS SIGNED-SHORT. 03 WINPRINT-IS-DEFAULT SIGNED-SHORT. 03 WINPRINT-COPIES SIGNED-SHORT. 03 WINPRINT-ORIENTATION SIGNED-SHORT. 03 WINPRINT-QUALITY SIGNED-SHORT. 03 WINPRINT-CURR-ORIENTATION SIGNED-SHORT. 03 WINPRINT-CURR-COPIES SIGNED-SHORT. 03 WINPRINT-DUPLEX SIGNED-SHORT. 03 WINPRINT-COLLATE SIGNED-SHORT. 03 WINPRINT-COLOR SIGNED-SHORT. 03 WINPRINT-CURR-DUPLEX SIGNED-SHORT. 03 WINPRINT-CURR-COLLATE SIGNED-SHORT. 03 WINPRINT-CURR-PAPERSIZE SIGNED-SHORT. 03 WINPRINT-CURR-TRAY SIGNED-SHORT. 03 WINPRINT-CURR-COLOR SIGNED-SHORT. 03 WINPRINT-JOB-TITLE PIC X(80).
This group item has numerous conditional variables. See winprint.def for the complete list.
A printer is considered selected if it has performed a print using -Q printername or -P SPOOLER, or if WIN$PRINTER has executed using any of the WINPRINT-DATA op-codes. If no printer is selected, this operation will return information about the Windows default printer.
The printer may be open or closed to perform these functions. There is no need to reset any of these functions. WINPRINT-SELECTION should be initialized prior to use. WINPRINT-GET-CURRENT-INFO-EX has all the same values as WINPRINT-GET-CURRENT-INFO plus the following additional values:
|WINPRINT-DUPLEX||Determines if the currently selected printer supports duplex printing. If yes, the returned value is WPRT-HAS-DUPLEX.|
|WINPRINT-COLLATE||Determines if the currently selected printer supports collating. If yes, the returned value is WPRT-HAS-COLLATE.|
|WINPRINT-COLOR||Determines if the currently selected printer can print in color. If color printing is supported, the returned value is WPRT-HAS-COLOR.|
|WINPRINT-CURR-DUPLEX||Returns the current duplex setting of the printer. Possible values are: WPRT-SIMPLEX, WPRT-DUPLEX-VERTICAL, and WPRT-DUPLEX-HORIZONTAL.|
|WINPRINT-CURR-COLLATE||Determines if the collating feature of the currently selected printer is turned on or off.|
|WINPRINT-CURR-PAPERSIZE||Returns the current paper size selected in the printer driver. Values less than 42 should correspond to the PAPER-SIZES table in "winprint.def". Values greater than 41 and less than 69 are defined by version 4.x of Windows NT. Values greater than 68 and less than 119 are defined in Windows 2000. Values greater than 118 and less than 256 are considered undefined. Values greater than 255 are considered user defined.|
|WINPRINT-CURR-TRAY||Returns the currently selected paper tray as defined in the printer driver. Values less than 16 should correspond to the PAPER-TRAYS
winprint.def. Values greater than 15 and less than 256 are considered undefined. Values greater than 255 are considered device specific.
Values 12 and 13 are not defined in the PAPER-SIZES table in winprint.def. This matches a similar gap in the Windows API. Refer to prndemox.cbl for an example of how to compensate for these undefined values.
|WINPRINT-CURR-COLOR|| Determines if the printer is in the proper mode to print in color. If yes, WPRT-COLOR is returned. Monochromatic printers
or color printers with color support disabled return WPRT-MONOCHROME.
Note: When using one of these extended operations, it is best to pair it with a corresponding extended operation. For example, use WINPRINT-GET-CURRENT-INFO-EX with WINPRINT-SET-PRINTER-EX, instead of with WINPRINT-SET-PRINTER.