From: tmoran@bix.com
Subject: Re: more specific, was:change screen colour??
Date: 2000/08/26
Date: 2000-08-26T00:00:00+00:00 [thread overview]
Message-ID: <6yUp5.135921$i5.1994143@news1.frmt1.sfba.home.com> (raw)
In-Reply-To: 39a7ed56$0$20400@echo-01.iinet.net.au
>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
1. Look up ANSI.SYS and see if that will let you send a control
sequence to change the background color.
2. See if there's something in MS's "Accessibility Options" (for
those with poor vision, say) that will do it.
3. See if there is an int21 or a BIOS int10 call and your program can
use it (I don't recall one, but it's been a while).
4. Have your program go and change the color attribute byte on the
(emulated) DOS screen. Using an old Ada83 compiler and running in
a DOS window under Win95, this program gives the leftmost 20 columns
a blue background. Every time you scroll a line, though, you need to
repaint black to blue on the new area.
with text_io;
with system;
procedure blue is
-- test blue-ing background on DOS window
type col_types is new integer;
type row_types is new integer;
subtype cols is col_types range 1 .. 80;
subtype rows is row_types range 1 .. 24;
type ibm_chars is record
char:character;
attribute:system.byte;
end record;
type lines is array(cols) of ibm_chars;
type screens is array(rows) of lines;
screen:screens;
for screen use at (16#B800#,0);
begin
text_io.put_line("line one");
text_io.put_line("line two");
text_io.put_line("line three");
for r in screen'range loop
for c in cols range 1 .. 20 loop
screen(r)(c).attribute:=16#17#;
end loop;
end loop;
text_io.put_line("line four");
text_io.put_line("line five");
text_io.put_line("line six");
delay 10.0;
end blue;
The line
for screen use at (16#B800#,0);
is going to take some work, however, since you'll probably have to ask
Windows for an address of the (simulated) DOS text RAM, and tell your
Ada 95 compiler to use that address.
Sorry that such a straightforward request results in such a long
answer. Perhaps others can suggest other approaches.
next prev parent reply other threads:[~2000-08-26 0:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-08-25 0:00 change screen colour?? Damon Carter
2000-08-26 2:53 ` DuckE
2000-08-26 0:00 ` Damon Carter
2000-08-26 0:00 ` tmoran
2000-08-26 0:00 ` Marin D. Condic
2000-08-27 7:26 ` more specific Damon Carter
2000-08-26 0:00 ` tmoran [this message]
2000-08-28 0:00 ` more specific, was:change screen colour?? Jerry van Dijk
2000-08-26 0:00 ` more specific (null)
2000-08-26 0:00 ` Al Christians
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox