Lazarus
Free Pascal => Beginners => Topic started by: joho on September 13, 2017, 11:03:27 pm
-
program testh;
uses
video;
begin
InitVideo;
Writeln (ScreenHeight);
Writeln (ScreenWidth);
end.
Outputs 56 and 132. In a CMD window (Win10Pro64) that I have defined as 132x50. Why?
If I change the window size to 80x43, I'll get 80 width, and 56 height, why?
Doing a GetVideoMode (), I get the same value in "Row".
(FPC 3.0.2)
-
I believe SreenHeight and ScreenWith are defined in the unit CRT.
-
IIRC a windows cmd has two sizes. One for the visible resolution, one of the scrollbackbuffer.
You are seeing the scrollback buffer one, at least the part that has been used (which can be smaller than the max scrollbuffer size if the cmd.exe is just started).
-
IIRC a windows cmd has two sizes. One for the visible resolution, one of the scrollbackbuffer.
You are seeing the scrollback buffer one, at least the part that has been used (which can be smaller than the max scrollbuffer size if the cmd.exe is just started).
Hmm ... OK ... I guess that "makes sense", but if I don't want to rely on CRT, how would I fetch the actual screen height/width? Using the RTL I mean.
-
Video has screenwidth/height too.
The only advise that I can give is study the textmode IDE. It sets the console in different modes that are more like a dos screen.
-
Video has screenwidth/height too.
The only advise that I can give is study the textmode IDE. It sets the console in different modes that are more like a dos screen.
Thanks. Will do.