color output

C

Carramba

Hi again :)

is it posible to get color output in dos aplication with C?
if yes how?!

thanx in advance!
 
J

Joona I Palaste

Carramba said:
is it posible to get color output in dos aplication with C?
if yes how?!
thanx in advance!

That depends on your console settings, and is not defined by C. Please
ask in a DOS newsgroup.

--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"You can pick your friends, you can pick your nose, but you can't pick your
relatives."
- MAD Magazine
 
C

Carramba

That depends on your console settings, and is not defined by C. Please
ask in a DOS newsgroup.
what does it have to do with console setings? you can overwrite it! it's
in WinApi.h .... so I gues it's defined by C...


--
Thanx in advance!

;-)

______________________________________
I se the lightat the end, but every time I take a step it's get dim.
 
J

Joona I Palaste

Carramba said:
what does it have to do with console setings? you can overwrite it! it's
in WinApi.h .... so I gues it's defined by C...

WinApi.h is part of your operating system, not part of the C
programming language. All the world is not MS Windows, you know. Please
find a Windows or MS-DOS newsgroup.
 
L

Lew Pitcher

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
what does it have to do with console setings? you can overwrite it!
it's in WinApi.h .... so I gues it's defined by C...

No, it's not "defined by C". WinApi.h is not part of the standard C language,
and is not discussed here.

OTHO, WinApi.h is defined by Microsoft, for use by their extensions to standard
C, on the Microsoft Windows operating system. So, if you want to discuss
WinApi.h, your best bet is to join one of the comp.os.ms-windows newsgroups and
discuss it there.





- --
Lew Pitcher
IT Specialist, Enterprise Data Systems,
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed are my own, not my employers')
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFCB7HlagVFX4UWr64RAtApAKCu8R8l9LHiehS9J1zCqnPetzcoFQCeIake
Idfw3rYvrAUew/ct9A5PaO0=
=+SRW
-----END PGP SIGNATURE-----
 
M

Mabden

Carramba said:
Hi again :)

is it posible to get color output in dos aplication with C?
if yes how?!

If you can guarantee that ANSI.SYS is loaded, you could output ANSI
codes in the text. These are strings that begin with an ESC character
(ANSI code decimal 27), then a square bracket, followed by a code
sequence.

This example may work for you if it gets through unchanged (put it in a
batch file to see it work). I can't test it as my Win2K system runs
CMD.EXE not DOS. It is part of a color selection batch file I used to
use.

=============================
@echo off
REM Note: ANSI.SYS device driver must be loaded in C:\CONFIG.SYS
REM Choose foreground colors.
echo  B. Black  K. blacK
%color%
echo  R. Red  D. reD
%color%
echo  G. Green  N. greeN
%color%
echo  O. Orange  Y. Yellow
%color%
echo  L. bLue  E. bluE
%color%
echo  M. Magenta  T. magenTa
%color%
echo  C. Cyan  A. cyAn
%color%
echo  W. White  H. wHite
%color%

=============================

But the real question is, "Why am I coding C in DOS?"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top