We help IT Professionals succeed at work.

DOS function for Text Windows size

dbrunton
dbrunton asked
on
410 Views
Last Modified: 2014-08-11
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.
Comment
Watch Question

dsackerContract ERP Admin/Consultant
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.
CERTIFIED EXPERT

Author

Commented:
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.
dsackerContract ERP Admin/Consultant
CERTIFIED EXPERT

Commented:
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.
Fixer of Problems
CERTIFIED EXPERT
Most Valuable Expert 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.
CERTIFIED EXPERT

Author

Commented:
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.
Dave BaldwinFixer of Problems
CERTIFIED EXPERT
Most Valuable Expert 2014

Commented:
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.
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.
CERTIFIED EXPERT

Author

Commented:
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.
dbruntonQuid, Me Anxius Sum?  Illegitimi non carborundum.
CERTIFIED EXPERT

Author

Commented:
Must RTFM again and remember what is in there.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.