I tried typing

printf("\033[34m");

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

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

and

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

Member Avatar for iamthwee

I tried typing

printf("\033[34m");

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

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

and

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/smartfaq.cgi?answer=1048382857&id=1043284392

commented: Nice Link-[grunt] +2

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.