Thread: text color?

  1. #1
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071

    text color?

    how would you change text color???

    my code to draw the text is somthing like:

    DrawText (hdc, "text here", -1, &rc,
    DT_SINGLELINE | DT_CENTER | DT_VCENTER);

    how do i change the color??

    (i have dev-c++)
    -thanks

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    use this function before your text out:
    SetTextColor(hdc, RGB(255, 0, 0));

    This will create a bright red text and the function returns the previous color you had selected as a COLORREF.

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    30
    is it possible to changce text color in console applications?

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    That is in the FAQ

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GUI Text Color Problem
    By justlivelife15 in forum Windows Programming
    Replies: 3
    Last Post: 06-25-2007, 05:47 AM
  2. Change text color in C
    By IndioDoido in forum C Programming
    Replies: 9
    Last Post: 04-15-2007, 05:54 AM
  3. Critique my lighting model.
    By psychopath in forum Game Programming
    Replies: 4
    Last Post: 08-12-2006, 06:23 PM
  4. Color text from windows.h?
    By Saintdog in forum C++ Programming
    Replies: 10
    Last Post: 12-03-2004, 09:20 AM
  5. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM