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.
LVL 50
dbruntonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dsackerContract ERP Admin/ConsultantCommented:
Try:  MODE CON: /STATUS

You could pipe that into the FIND command to filter on "lines" and "columns" and even set DOS variables. If you need further info on that, let me know.

Don't forget to include the CON: parameter, else it runs much slower.
0
dbruntonAuthor 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.
0
dsackerContract ERP Admin/ConsultantCommented:
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.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Dave BaldwinFixer of ProblemsCommented:
You may be able to get the info from INT 10h, function 1Bh, but you'll have to do some arithmetic.  http://stanislavs.org/helppc/int_10.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dbruntonAuthor 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.
0
Dave BaldwinFixer of ProblemsCommented:
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.
0
dbruntonAuthor 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.
0
dbruntonAuthor Commented:
Must RTFM again and remember what is in there.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.