943,829 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 5092
  • C++ RSS
Sep 23rd, 2006
1

Using the ANSI driver to display screen colors

Expand Post »
I tried typing

C++ Syntax (Toggle Plain Text)
  1. printf("\033[34m");

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

C++ Syntax (Toggle Plain Text)
  1. device=D:\WINDOWS\system32\ansi.sys

and

C++ Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 50
Solved Threads: 0
Junior Poster in Training
Diode is offline Offline
70 posts
since Jan 2005
Sep 23rd, 2006
2

Re: Using the ANSI driver to display screen colors

Click to Expand / Collapse  Quote originally posted by Diode ...
I tried typing

C++ Syntax (Toggle Plain Text)
  1. printf("\033[34m");

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

C++ Syntax (Toggle Plain Text)
  1. device=D:\WINDOWS\system32\ansi.sys

and

C++ Syntax (Toggle Plain Text)
  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
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Sep 23rd, 2006
1

Re: Using the ANSI driver to display screen colors

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.
Moderator
Reputation Points: 3278
Solved Threads: 892
Posting Sage
WaltP is offline Offline
7,718 posts
since May 2006
Sep 23rd, 2006
1

Re: Using the ANSI driver to display screen colors

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.
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Working in Visual C++ to parse some text files
Next Thread in C++ Forum Timeline: VC++2005 express help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC