Thread: SetConsoleTextAttribute()

  1. #1
    Unregistered
    Guest

    SetConsoleTextAttribute()

    is there a color value for black?
    I'm trying to output using a black foreground and white background. I've tried using FOREGROUND_BLACK but it didn't work.

  2. #2
    Unregistered
    Guest
    black is 0

  3. #3
    0x01
    Join Date
    Sep 2001
    Posts
    88
    Try this:

    SetConsoleTextAttribute (GetStdHandle(STD_OUTPUT_HANDLE), BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY);

    That should make the text black with a very white background.
    Note: You can mix colors.
    inorder to make 'white', you have to mix those three colors.
    You can also change the BACKGROUND to FOREGROUND.
    INTENSITY will make the colors look brighter.

  4. #4
    0x01
    Join Date
    Sep 2001
    Posts
    88
    oh wait, check this out man. I just found this.

    http://sunlightd.virtualave.net/Wind...leChangeColour

    It's a good place for other info on windows console programming too.

Popular pages Recent additions subscribe to a feed