From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c894ce2937221e2e X-Google-Attributes: gid103376,public From: Al Christians Subject: Re: more specific Date: 2000/08/26 Message-ID: <39A839D0.6884C1E7@easystreet.com>#1/1 X-Deja-AN: 662840764 Content-Transfer-Encoding: 7bit References: <39a77575$0$20391@echo-01.iinet.net.au> <39A7C7A9.F9DDD421@acm.org> <39a7ed56$0$20400@echo-01.iinet.net.au> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsabuse@supernews.com Organization: Trillium Resources Corporation MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-08-26T00:00:00+00:00 List-Id: I remember doing this with the DOS version of Gnat, currently distributed as EZ2LOAD, IIRC. This runs under a DOS extender, and produces executables that do the same. When you run a DOS program under Win95, Win98 or NT, you do get most of the features of DOS available for you program. There are library functions that are part of the extender lib that comes with EZ2LOAD that you can call from the Ada program that give access to the DoS text video buffer. This includes attribute bytes that control the color of text on the screen. Move the right values into the attribute bytes, and the color of the screen will change accordingly. Alternatively, if you can set up the target system to load Ansi.Sys when it opens a DOS command prompt, you can set the screen colors by printing escape sequences through the standard output from your Ada program, and you could probably do that with programs from any of the Ada compilers for Windows. Windows NT won't load Ansi.Sys, but I think that Windows 95 can. Escape sequences are special output that are interspersed with the normal output. Ansi.Sys watches the output, and when it sees an escape character (Ascii 27), it interprets whatever comes after it as a control code that tells it to something special, like change the screen colors or move to a certain spot on the screen. I'm sorry to say that it has been about five years since I did this, so I can't recall too many details, and I haven't touched DOS in about 3 years, and I have pitched all my old DOS documentation. You should be able to find documentation about Ansi.Sys somewhere on-line. It is a portable way to make text-mode output a little prettier. It didn't catch on for DOS PC's mainly because it slowed down the output noticeably, but with faster computers now, I doubt anyone will notice. It also makes a mess of your screen if you accidentally send an escape character to the standard output without valid control codes following. If one set of colors is ok throughout your program, the simplest way to do this is to run your program from a batch file. Compile and link your program as, eg, MyProg.Exe. Then execute it with a batch file like: :REM 1f is background 1=Blue, foreground F=White Color 1F MyProg.Exe Al Damon Carter wrote: > > Im writing a program using ada95 compiler thats going to run in a dos > window, > and i want to change the dos window colour from black to blue.. i am > using windows 95 and have 32bit video card.. i think > > Damon, Carter