GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 30-Jul-2006, 03:54
bigkIDmarie bigkIDmarie is offline
New Member
 
Join Date: Apr 2006
Posts: 4
bigkIDmarie is on a distinguished road

Changing font style and color of text in C


The text color and font is the same throughout the whole exe file. How can I call library and change them?
I want to set the given numbers to red in a sudoku.

P.S. Are there any online sudoku source codes in C?
Thank you.
  #2  
Old 30-Jul-2006, 10:20
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,791
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Changing font style and color of text in C


Quote:
Originally Posted by bigkIDmarie
The text color and font is the same throughout the whole exe file. How can I call library and change them?
I want to set the given numbers to red in a sudoku.

P.S. Are there any online sudoku source codes in C?
Thank you.

Since you refer to "exe" file, I am assuming you are running some version of Windows. You might tell us which version (Windows98, XP, or what?) Sometimes it makes a difference (but probably not, for this particular question).

I assume you aren't running a "Windows" API program (the stuff with handles, winmain, etc.), but a command line program (the program has a main() function and runs in a "command prompt" window). (If you were running Windows API, then, depending on how you are actually displaying program output, there are tons of ways to change the appearance.)

There aren't any standard C library functions that have any awareness of stuff like fonts and colors, etc., or anything else that is associated with physical attributes of your screen or anything else in your system. This is deliberate and by design, since the idea is that the language and its standard library functions are to be as portable as possible among the many, many (well, maybe not that many) operating systems and hardware implementations.

For command-line C (or C++) programs running on Windows XP (and, probably some earlier versions of Windows also), here is a site with lots of stuff that I found very interesting:

http://www.adrianxw.dk/SoftwareSite/...Consoles1.html

Start at the beginning and go forward a few lessons to get to the color stuff.

Linux users/programmers might look into the ncurses library to control screen output in a non-GUI console window. (Ncurses may already be on your system, depending on what Linux distribution you have installed.)

Regards,

Dave
 
 

Recent GIDBlogStupid Management Policies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:48.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.