Thread: background color

  1. #1
    Unregistered
    Guest

    Smile background color

    I am new to c programming, and have looked all over the internet and found conio.h but it does not have a background prototype. Can someone help me out and show me what to do to just change the background color in my c program running in dos?

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    when you say dos do you really mean dos or do you mean the windows console which looks very much like dos. In dos nearly everything like this is done by calling an interrupt routine but in windows console these routines are no longer valid.Instead you have the win32 api at your beck and call. now which is it?
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Unregistered
    Guest
    I would like to know how to change the background color in a DOS program. If I were to write a program in c, then exit to dos and run that program, how do I make the screen color change to say blue? Furthermore I would like to learn how to do this without an existing .h function so I may put it in just about any program. I have an idea that it would involve dos interrupts but do not know how to invoke them, and put my display on the screen. I have looked all over the net and only found bits and pieces to my question, nothing very clear. Can anyone help?

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Use Borland's Turbo Pascal 7. It doesn't get much easier than that...

    Quzah.
    Hope is the first step on the road to disappointment.

  5. #5
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    suggest your first port of call be google to look for "Ralf Brown's interrupt list".
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  6. #6
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    or... tinker with b800:0000... that's the 80x25 conventional memory address... just make sure you stay within your 3200 bytes tho... and RBIL is a great tool, dl it today!
    hasafraggin shizigishin oppashigger...

  7. #7
    Unregistered
    Guest
    would you please tell me more about what you mean when you talk about working with b800:0000, the 80x25 conventional memory address? and if you can give some examples? Thank you so much.

  8. #8
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    set up a pointer to the address... and use that pointer to alter the data at the memory location which it points to... then you'll see the changes on the screen...

    unsigned char * text_addr = (unsigned char *) (0xb8000000);
    hasafraggin shizigishin oppashigger...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Critique my lighting model.
    By psychopath in forum Game Programming
    Replies: 4
    Last Post: 08-12-2006, 06:23 PM
  2. Windows background color
    By Exile in forum Windows Programming
    Replies: 2
    Last Post: 01-23-2005, 07:55 AM
  3. Setting the background color of my main window
    By Garfield in forum Windows Programming
    Replies: 5
    Last Post: 07-06-2002, 11:25 PM
  4. Text and background Color
    By Goof Program in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 03-29-2002, 06:59 PM
  5. Just one Question?
    By Irish-Slasher in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2002, 10:19 AM