Link to home
Start Free TrialLog in
Avatar of dbrunton
dbruntonFlag for New Zealand

asked on

DOS function for Text Windows size

I'm looking for a DOS function that I can call under text mode in DOS to tell me the text dimensions of the current window.

Normally it is 80 x 25 or 80 x 43 or 80 x 50.  In some video BIOSes you can set it up to 132 by 60.  VDOS http://sourceforge.net/projects/vdos/ also permits unusual settings and I can get Turbo Pascal to do 132 by 60 there (brief test only).

So does anyone know what I'd call in DOS to get those dimensions?  NOT how to set those dimensions.  That's a totally different game and not one I want to attempt.  I'm presuming that an offbeat text window has been set by some other application and I want to be able to read what it has been set to.
SOLUTION
Avatar of dsacker
dsacker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dbrunton

ASKER

Hmm.  I probably haven't explained properly.

I'm not looking for the DOS command but a DOS programming function.

Eg
int 33h and function 00h, call with ax=0000h is used to reset the mouse and get the status.
Okay, that had me chuckling. Yeah, I misinterpreted. Sorry.

You may want to look at the GetConsoleDisplayMode, GetConsoleWindow, and similar Windows API functions. I think what you're looking for is in there, although it's been awhile since I have delved there.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Probably not the Windows functions but the DOS functions that Dave Baldwin linked too.

Yeah, it's in my Ray Duncan Advanced MSDOS Programming book on page 531.  Should have looked in there first but I was lazy.

Right, so that's what I'll be doing when I get some free time.
More info here: http://cs.lmu.edu/~ray/notes/pcvideomodes/
And this says that the video columns is listed in the BIOS data segment: http://support.microsoft.com/KB/120565  but there are problems discussed there.
No, I've actually don't have to do any fancy programming.  No need to touch INT 10h, function 1Bh or any Windows APIs.  Brain has gone into functional mode.

Turbo Pascal has a variable WindMax which has the rows and columns in it.   I've just done a quick test using WindMax and it identifies a normal 80 by 25 text screen and an extended text screen of 132 by 60.  My version of Turbo Pascal doesn't have a normal (Crt) screen unit and doesn't (default) switch into any of the standard 80 x ?? modes if it identifies a non-standard text mode.

Now I can pull the maximum values out of WindMax and use those to set the dimensions of my  text window with no problems.  So problem solved.

Merci all.
Must RTFM again and remember what is in there.