Thread: Color Glitches in Console Prog.

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    15

    Angry Color Glitches in Console Prog.

    I'm writing a Console Text-Based RPG, and for several areas in the game I set the text color, using StdOutHandleblah blah blah. I'm not looking at my code so I can't remember it, but i'm sure you know what i'm talking about, Anyway, I setup a function to get my 16 Basic Colors, when I call the colors they work, but occasionally, they don't, it seems to be random where the program go goin to fast and jumped the color line, something like that. Not sure how to explain it, if you reload whatever screen your on where the color is messed, it will usually go right, and if you continue to refresh some other part will change colors when it's not supposed to.

    On the point of rambling now. Has anyone else experienced this? Some kind of fix, or just something that must be delt with?

    Thanx if you can help,
    Darkflame

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    3

    Angry same sort of problem

    Yes this is definatly a problem. I am having a very similar problem and nobody seems to know how to fix this or doesn't seem to reply. I have found that this error occurs whenver my console has to scroll. After that the default colors take over everything.

  3. #3
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823

    Angry

    I guess I'll use the mad face, since that seems to be en vogue.

    Anyways, your problem could be a lot of things... Without code, it's hard to tell what it is...

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    3

    Post the code in question

    This is the piece of code that is causing the problem:

    SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED|BACKGROUND_GREEN );

    I got this code off a post from another member. it does the trick until the console scrolls. after that the colors dissapear for about 5 lines and then are unchangable. i use the msvc++ v.6 compiler and am building win 32 console apps.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Full Screen Console
    By St0rmTroop3er in forum C++ Programming
    Replies: 1
    Last Post: 09-26-2005, 09:59 PM
  2. Console Prog
    By Azh321 in forum C++ Programming
    Replies: 3
    Last Post: 11-26-2003, 02:52 PM
  3. Help on simple text console prog...
    By Azh321 in forum C++ Programming
    Replies: 2
    Last Post: 11-26-2003, 07:03 AM
  4. When prog is compiled the Console becomes FULLSCREEN
    By IrishSlasher in forum C++ Programming
    Replies: 2
    Last Post: 11-06-2002, 09:25 AM
  5. Just one Question?
    By Irish-Slasher in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2002, 10:19 AM