CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Wm_erasebkgnd

  1. #1
    Join Date
    Oct 2004
    Posts
    270

    Wm_erasebkgnd

    I wrote:
    >>CPaintdc dc(this);//in a function of mydialog
    >>SendMessage(WM_ERASEBKGND,(WPARAM)dc,0)
    but the background of my dialog doesn't erase...
    Can someone tell me what's wrong?
    Thank you,
    Isabella

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Wm_erasebkgnd

    You should call InvalidateRect to tell window to repaint and erase background.
    Code:
    RECT rect;
    /// fill out parameters in rect to specify which rectangle on the window to mark for repaint,
    // passing NULL would invalidate complete window
    // second parameter is to tell whether to erase background or not.
    myView->InvalidateRect(NULL, TRUE);
    Or
    ::InvalidateRect(hWnd, &rect,TRUE);
    Regards,
    Ramkrishna Pawar

  3. #3
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Wm_erasebkgnd

    WM_ERASEBKGND is notification sent to your window when the background must be erased, you should not "Send" this message to force background erase.
    Regards,
    Ramkrishna Pawar

  4. #4
    Join Date
    Oct 2004
    Posts
    270

    Re: Wm_erasebkgnd

    thanks a lot

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

Featured