This operation code returns information about the currently selected printer.
CALL "WIN$PRINTER" USING WINPRINT-GET-CURRENT-INFO, 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. 88 WPRTERR-NO-PRINTERS VALUE -1. 03 WINPRINT-IS-DEFAULT SIGNED-SHORT. 88 WPRT-IS-NOT-DEFAULT VALUE 0. 88 WPRT-IS-DEFAULT VALUE 1. 03 WINPRINT-COPIES SIGNED-SHORT. 88 WPRT-HAS-NO-COPY VALUE 1. 03 WINPRINT-ORIENTATION SIGNED-SHORT. 88 WPRT-HAS-NO-LANDSCAPE VALUE 0. 88 WPRT-HAS-LANDSCAPE VALUE 1. 03 WINPRINT-QUALITY SIGNED-SHORT. 03 WINPRINT-CURR-ORIENTATION SIGNED-SHORT. 03 WINPRINT-CURR-COPIES SIGNED-SHORT.
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 has the following values:
|WINPRINT-NAME||Returns the name of the currently selected printer.|
|WINPRINT-PORT||Specifies the printer port (or UNC address) of the currently selected printer.|
|WINPRINT-DRIVER||Specifies the printer driver name.|
|WINPRINT-DRV-VERSION||Specifies the version number of the printer driver (vendor-specific).|
|WINPRINT-NO-OF-PRINTERS||Specifies the number of the currently selected printer in the runtime's internal list.|
|WINPRINT-IS-DEFAULT||Determines if the printer is the Windows print spooler default printer. If yes, the returned value is WPRT-IS-DEFAULT.|
|WINPRINT-COPIES||Returns the number of copies the printer is capable of producing. Typically this number is 99 or 999.|
|WINPRINT-ORIENTATION||Determines if the printer supports landscape orientation. If yes, the return value is WPRT-HAS-LANDSCAPE.|
|WINPRINT-QUALITY||Returns the current setting for the varying grades of print quality.
This value applies to dot-matrix printers. Most inkjet and laser printers do not support this method of determining the level of print quality.
|WINPRINT-CURR-COPIES|| Returns the current default value for the number of copies to print.
Note: Windows provides two types of printer drivers. The first type can print multiple copies with no application support, and the second type requires the application to detect the number of copies requested by the user, and to print the number of copies detected. With the second type, neither the printer driver nor anything with which it is associated stores the number of copies requested by the user. The runtime initially does store that information; however by calling WIN$PRINTER with WINPRINT-UPDATE-PRINTERS, the runtime deletes all printer information and then reloads it from the printer driver. Because the printer driver doesn't store the number of copies, that information is lost.