Results 1 to 13 of 13

Thread: Colored Text...

  1. #1
    AnT
    Guest

    Colored Text...

    How would I go about printing colored text with the DrawText function?

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    You'll have to first set the colour of the text using "SetTextColor".
    Example:
    PHP Code:
    SetTextColor(myhdcRGB(0,255,0));
    //DrawText.... 
    Baaaaaaaaah

  3. #3
    AnT
    Guest
    Wow you're quick...thanks

  4. #4
    AnT
    Guest
    Now...how can I change the background color of a window?

  5. #5
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    I think "SetBackColor" will work.
    Example:
    PHP Code:
    SetBackColor(winhdcRGB(0,0,255)); 
    PS: You can always look up at MSDN for reference on API.
    Baaaaaaaaah

  6. #6
    AnT
    Guest
    Thanks, and thanks for pointing MSDN out to me, lol.

  7. #7
    AnT
    Guest
    D:\Program Files\Microsoft Visual Studio\MyProjects\w32paint\w32paint.cpp(168) : error C2065: 'SetBackColor' : undeclared identifier

  8. #8
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Ops, it's "SetBkColor".
    Baaaaaaaaah

  9. #9
    AnT
    Guest
    This makes the background what I choose only on the local RECT that I define. How can I make it so that it changes the BG for the entire window?

  10. #10
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    You'll have to first get the handle of your whole window using either "GetDC" or "GetWindowDC".
    Baaaaaaaaah

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    When creating the window class you can set the background brush.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  12. #12
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810
    Code:
    WNDCLASSEX wnd;
    
    wnd.hbrBackground=(HBRUSH)(COLOR_WINDOW+1);

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Or:
    wc.hbrBackground = CreateSolidBrush(RGB(0, 255, 127));
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width