I have a CStatusBar
at the bottom of my dialog. And during OnSize
and OnHScroll
I call a function called MoveStatusBar
. When it is called from OnSize
I pass the value false to stop redrawing.
Function:
void CMyDialog::MoveStatusBar(const bool redrawWindow /*= false*/)
{
CRect rect;
GetClientRect(&rect);
if (m_StatusBar.GetSafeHwnd())
{
CRect rctCombo;
m_cbChairman.GetWindowRect(&rctCombo);
const int statusBarHeight = rctCombo.Height() + 4;
m_StatusBar.SetWindowPos(nullptr, 0,
rect.bottom - statusBarHeight, rect.Width(), statusBarHeight, SWP_NOZORDER | SWP_NOACTIVATE);
if (redrawWindow)
{
m_StatusBar.RedrawWindow(nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
}
}
}
What I don’t understand is that when I horizontally scroll the whole dialog that the dialog has zero flashing and yet the status bar flashes a great deal. Can the flashing be prevented?