CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2005
    Location
    Netherlands, The
    Posts
    2,184

    major redraw problems.

    Hi.

    Yet again some winapi problem...
    My window has trouble redrawing itself. When i drag any window over my window than it will redraw itself right. But when i am resizing or on fresh start, my window does not correctly redraw. ( see attachment)

    my window has these styles:
    Code:
    			LClass.style = CS_PARENTDC;
    			cCreate.style = WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW;
    my controls also have the WS_CLIPCHILDREN | WS_CLIPSIBLINGS flags.. I trieed without these flags and the problems still occur.

    in the WM_CREATE event of my window im calling ShowWindow and UpdateWindow and activatewindow...

    when my listview is in icon view. it draws scrollsbars but it doesnt draw them right(unless i put a difrent window ontop and then activate my window again it draws ok.)

    in the resize event im calling MoveWindow on my controlls with brepaint to False...

    so my question is... is the poroblem with the style flags? or is it i need to set bRepaint to true... thanks
    Attached Images Attached Images
    Last edited by Mitsukai; September 16th, 2008 at 10:53 AM.

  2. #2
    Join Date
    Jan 2007
    Posts
    38

    Re: major redraw problems.

    The easiest solution would probably be to add CS_HREDRAW | CS_VREDRAW to the class styles, but there's a very nice article about this sort of issue here, which also gives other solutions that might suit your situation better.
    I am a beginning C++ Win32 programmer with LOTS of questions. Hopefully matching answers can be found here...

  3. #3

    Re: major redraw problems.

    Look into double buffering your own window, and still use the WS_CLIP*** flags for the children and siblings.

    Encompasses painting in a memory DC, then blitting that to your paint DC.

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