reduce window flickering when doing many changes

Discussion in 'C' started by DavidB3, Mar 8, 2015.

  1. DavidB3

    DavidB3 New Member

    Joined:
    Mar 8, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi.

    I'm doing a small tool. I compile the code with gcc in MingW.

    One of its windows has a lot of normal controls on it (comboboxes, editboxes, textboxes, groupboxes...).
    I'm trying to reduce the window flickering (when modifying the controls) by using this code:

    Code:
    //button click event
    SetWindowRedraw(hWnd,FALSE);
    
    //do a lot of modifications (hide/show/move/edit controls with their repaint disabled)
    
    SetWindowRedraw(hWnd,TRUE);
    //here I get the rect of the update region
    RedrawWindow(hWnd, &updrect, 0, RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN | RDW_UPDATENOW);

    It flickers a little less, but it can be improved.
    Is there a way?

    I know about "double buffered", implemented in Delphi successfully but couldn't find a way in C.

    Thank you.

    Regards,
    David
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice