Reducing flickering when resizing
I am looking for ways to reduce flickering when resizing. I've set WS_CLIPCHILDREN on parent windows, which reduced a lot of flicker. I couldn't find anywhere were WS_CLIPSIBLINGS made a difference. I still have a lot of flicker, and its only really in 3 places. In my edit controls, tab controls, and list controls, there is a lot of flickering when resizing. How do I stop this from happening?
edit: I've also tried to put FALSE in the last parameter of MoveWindow, that doesn't help and causes really bad smearing effects. also tried making window classes without CS_VREDRAW and CS_HREDRAW in PreCreateWindow, usually caused bad smearing effects also.
Re: Reducing flickering when resizing
Where do you put those controls? What do you do on resizing? Do you move that controls to fit?
Re: Reducing flickering when resizing
here is an example of a WM_SIZE handler:
Code:
void CEdConsole::OnSize(UINT nType, int cx, int cy)
{
m_Text.MoveWindow(0, 0, cx, cy - 21);
m_Input.MoveWindow(0, cy - 18, cx - 52, 18);
m_Enter.MoveWindow(cx - 48, cy - 18, 48, 18);
m_Input.Invalidate(FALSE); // needed because for some reason little graphics errors occurred in the border
CSizingControlBarCF::OnSize(nType, cx, cy);
}
m_Text is a multiline readonly edit control, m_Input is a single line edit control, m_Enter is a button. The text m_Text flickers pretty badly when resizing. I tried passing FALSE in the last param of m_Text.MoveWindow, but it doesn't help, and it causes the scroll bars to get screwed up.
Re: Reducing flickering when resizing
Instead of .MoveWindow you might want to try .SetWindowPos function. I was having a similar problem and SetWindowPos solved it. Also you might be interested in WM_EXITSIZEMOVE to refresh once resizing ends. I hope these help.