| | |
Using the ANSI driver to display screen colors
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
I tried typing
for blue foreground color, and other values, but nothing worked. So I included:
and
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
C++ Syntax (Toggle Plain Text)
printf("\033[34m");
for blue foreground color, and other values, but nothing worked. So I included:
C++ Syntax (Toggle Plain Text)
device=D:\WINDOWS\system32\ansi.sys
and
C++ Syntax (Toggle Plain Text)
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
•
•
•
•
I tried typing
C++ Syntax (Toggle Plain Text)
printf("\033[34m");
for blue foreground color, and other values, but nothing worked. So I included:
C++ Syntax (Toggle Plain Text)
device=D:\WINDOWS\system32\ansi.sys
and
C++ Syntax (Toggle Plain Text)
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
http://faq.cprogramming.com/cgi-bin/...&id=1043284392
*Voted best profile in the world*
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
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
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.
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.
![]() |
Similar Threads
- Horizontal lines across display (Monitors, Displays and Video Cards)
- Identifying Drivers needed (Windows 95 / 98 / Me)
- display no higher than 16 colors (Windows 95 / 98 / Me)
- Hi New Here, 1st Post and its .....Not Another Blue Screen!!!! Yep Sure Is (Monitors, Displays and Video Cards)
- IBM thinkpad 390E screen (Monitors, Displays and Video Cards)
Other Threads in the C++ Forum
- Previous Thread: Working in Visual C++ to parse some text files
- Next Thread: VC++2005 express help
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph homeworkhelp iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg simple sorting spoonfeeding string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






