Using the ANSI driver to display screen colors

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2005
Posts: 70
Reputation: Diode is on a distinguished road 
Solved Threads: 0
Diode's Avatar
Diode Diode is offline Offline
Junior Poster in Training

Using the ANSI driver to display screen colors

 
1
  #1
Sep 23rd, 2006
I tried typing

  1. printf("\033[34m");

for blue foreground color, and other values, but nothing worked. So I included:

  1. device=D:\WINDOWS\system32\ansi.sys

and

  1. devicehigh=D:\WINDOWS\system32\ansi.sys

into my system.ini file to load the ANSI driver, both under the device part of the file, and it still didn't show any color. My Jamsa's C/C++ Programmer's Bible tells you to include the first device line I provided into config.sys if you use DOS. Well, I'm using Windows XP, and I couldn't find the config.sys file in my system.

I would like to include color text and highlighting (for menus) in my text-based RPG I'm making.

Any suggestions?

Thanks,
Diode
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Using the ANSI driver to display screen colors

 
2
  #2
Sep 23rd, 2006
Originally Posted by Diode View Post
I tried typing

  1. printf("\033[34m");

for blue foreground color, and other values, but nothing worked. So I included:

  1. device=D:\WINDOWS\system32\ansi.sys

and

  1. devicehigh=D:\WINDOWS\system32\ansi.sys

into my system.ini file to load the ANSI driver, both under the device part of the file, and it still didn't show any color. My Jamsa's C/C++ Programmer's Bible tells you to include the first device line I provided into config.sys if you use DOS. Well, I'm using Windows XP, and I couldn't find the config.sys file in my system.

I would like to include color text and highlighting (for menus) in my text-based RPG I'm making.

Any suggestions?

Thanks,
Diode
This ?

http://faq.cprogramming.com/cgi-bin/...&id=1043284392
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,117
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 282
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Using the ANSI driver to display screen colors

 
1
  #3
Sep 23rd, 2006
I haven't done this since I left DOS, but I believe you have to load the driver in the System information from the Control Panel. I don't believe config.sys is read in today's systems.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Using the ANSI driver to display screen colors

 
1
  #4
Sep 23rd, 2006
Use the win32 API as referenced in the examples of the cprogramming.com FAQ.

Even if you manage to load ansi.sys, it will only work for true DOS 16-bit applications (which implies some crusty old compiler like turboC).

Anything compiled in win32 will simply ignore it.

You could always use ncurses to get better portability.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC