Is there any way to direct the output from the “Print Screen” keyboard key directly to a printer?

Question ID : 251
Created on 2015-09-14 at 2:38 AM
Author : Veryant Support [support@veryant.com]

Online URL : http://support.veryant.com/support/phpkb/question.php?ID=251



The 'PrintScreen' key is directly handled by the OS and cannot be referenced in COBOL.

In that case you can develop an isCOBOL program that could be run as hotkey program. Example:
iscobol.hot_key.printscreen=7

The isCOBOL program PRINTSCREEN will be executed pressing F7 (by default F7 returns exception-value 7).
You can also consider to create a push-button "PrintScreen" in your GUI interface with a particular exception(101) associated to the iscobol.hot_key.printscreen=101.

This program should call "W$CAPTURE" routine (see installed sample under isCOBOLxxxsampleissampless-routinesWCAPTURE.cbl, or the sample written in the isCOBOL documentation at the W$CAPTURE description) to store an image file on disk.

So you can choose the printer and print the image file calling "WIN$PRINTER" routine with different op-codes like WINPRINT-SETUP, WINPRINT-PRINT-BITMAP (see installed sample under isCOBOLxxx/sample/issamples/s-routines/WINPRINTER.cbl)



Back to Original Question