text color?

This is a discussion on text color? within the C++ Programming forums, part of the General Programming Boards category; how would you change text color??? my code to draw the text is somthing like: DrawText (hdc, "text here", -1, ...

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

    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,209
    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,209
    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, 06:47 AM
  2. Change text color in C
    By IndioDoido in forum C Programming
    Replies: 9
    Last Post: 04-15-2007, 06:54 AM
  3. Critique my lighting model.
    By psychopath in forum Game Programming
    Replies: 4
    Last Post: 08-12-2006, 07: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, 10:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21