Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29275 Discussions

PrintScreen for CVF Console Application

jtraub
Beginner
607 Views
Hello
I'm presently updating some older DOS Fortran programs which use assembly code to initiate a printout of the text output via interrupt 5. As I understand, this no longer works under Win2000. Is there a method using CVF 6.6 to perform a printscreen in a Fortran console application? The printscreen must be initiated and controlled by the program.
Thanks for any contributions
Jochen
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
607 Views
Hi Jochen,
It's not so easy under Win32 as it used to be under good ol' DOS days. For the start, most printers do not support "plain text" mode at all, only "graphic" mode.
I suggest you download XFTLite.zip from http://www.geocities.com/jdujic/fortran/xft/xft_download.htm. It is a dialog-based application whichdemonstrates the basics of printing under Win32 -- take a look at OnPrint subroutine, which prepares a printer's DC for printing. If you add PD_RETURNDEFAULT flag to PD%Flags, the print dialog will not be invoked, but default properties of the default printer will be returned.
Subroutine DrawImage actually produces the graphic output, so you should substitute your own. As to how to actually read the console window's contents, take a look at ReadConsoleOutput, ReadConsoleOutputCharacterand/or ReadConsoleOutputAttribute APIs (haven't used them myself). Once you get the information, you can render it on printer's DC using XFTGDI XTextOut function (make sure to download the documentation as well) or TextOut/DrawTextEx APIs.
Hope this can get you started,
Jugoslav
0 Kudos
jtraub
Beginner
607 Views
Thanks Jugoslav,
for the information- I will have a look at the source you mentioned and start going into details...
Jochen
0 Kudos
Reply