[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

DOS function for Text Windows size

Posted on 2014-08-10
8
Medium Priority
?
325 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.
0
Comment
Question by:dbrunton
  • 4
  • 2
  • 2
8 Comments
 
LVL 20

Assisted Solution

by:dsacker
dsacker earned 600 total points
ID: 40252407
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
 
LVL 50

Author Comment

by:dbrunton
ID: 40252423
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
 
LVL 20

Expert Comment

by:dsacker
ID: 40252425
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 1400 total points
ID: 40252434
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
 
LVL 50

Author Comment

by:dbrunton
ID: 40252436
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
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 40252481
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
 
LVL 50

Author Comment

by:dbrunton
ID: 40252766
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
 
LVL 50

Author Closing Comment

by:dbrunton
ID: 40252771
Must RTFM again and remember what is in there.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Six Sigma Control Plans
Screencast - Getting to Know the Pipeline

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question