[fpc-pascal]FreePascal, Go32 and inDOS-flag

Aitor Santamaria Merino aitor.sm at wanadoo.es
Tue Jan 8 01:29:53 CET 2002


This is a question, but also a comment, that I hope could help many people.

I am trying to write a program to write a screehshot capture program, 
working as a TSR activated with certain combination (AltGr+F8). In order 
to avoid problems with 16/32 bit when doing a TSR, I have made it under 

Just in case you believe I am having that problem, I use the BIOS 
variable ABSOLUTE $0040:$004E to determine the pageoffset from segment 
$b800 to determine where the characters should be. It outputs a BMP file.

Well, the program works well, I have tried shooting plain COMMAND.COM 
and TurboC, and works fine.
However, I haven't been able to shoot any freepascal application. I'll 
explain what I see: I did this testing program (to create TEST.BMP file).
My fisrt testing was WITHOUT exec, I executed the program, then this 
test program.
My second testing was EXECuting internally.
I did another testing replacing delay(5000) by readln;readln;

uses crt, dos;

         exec ('VGASHOT.EXE','TEST');
         writeln ('inside');
         delay (5000);
         writeLn ('final');

In ALL the cases, the result was always THE SAME:
I could capture the 'final' word, but was NEVER able to capture the 
'inside' word.

But, see how curious, I have realised that my TSR program does not make 
use of DOS calls (other than SetIntVect,Keep, etc, performed only at 

So my question is: does any FreePascal program capture the inDOS flag 
forever until the program exits??


More information about the fpc-pascal mailing list