Results 1 to 4 of 4

Thread: WM_CTLCOLOREDIT Problem

  1. #1

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    WM_CTLCOLOREDIT Problem

    Alright, when an EDIT control gets that message, I deal with it like this:

    SetTextColor( (HDC)wParam, cset->Foreground() );
    SetBkMode( (HDC)wParam, cset->BackgroundMode() );
    SetBkColor( (HDC)wParam, cset->Background() );
    logBrush.lbColor = cset->Background() ;
    hBrush = CreateBrushIndirect(&logBrush);
    cset = 0;
    return (long)hBrush;

    cset foreground, background both return a COLORREF RGB Value
    BackgroundMode return TRANSPARENT.


    This works for all controls, except...THE EDIT!!!
    This cause's every problem in the last of my posts about the Edit Control.

    The problem: (stage before--> text in box)
    [en]"Homer"

    press enter where en is, should move Homer down 1 line. but:

    "Homer"
    "Homer"

    it copy's the word until I redraw.....WHY?!?!
    If I do not set the above the code on the EDIT then this problem is eliminated.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    The Edit control recieves that message before it is drawn. You have to redraw it or it won't change..

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339
    well, the background changes and the text changes just fine.

    The text box is just forever messed up when I try and type into it.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  4. #4

    Thread Starter
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339
    It seems I was changing the text background mode in the EDIT control to TRANSPARENT...that was the problem.

    OPAQUE or just leave it alone and it works fine with the new background colors.

    Such a small thing cause'd me many days grief.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

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