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

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)

Authored by: Veryant Support on Mon, Sep 14th, 2015 at 7:00 PM
This question has been viewed 3752 times so far.
Online URL: http://support.veryant.com/support/phpkb/question.php?ID=251

Powered by PHPKB Knowledge Base Software