::SetWindowLong(GetHwnd(), GWL_EXSTYLE, exstyleReal);
- // we must call SetWindowPos() to flash the cached extended style and
+ // we must call SetWindowPos() to flush the cached extended style and
// also to make the change to wxSTAY_ON_TOP style take effect: just
// setting the style simply doesn't work
if ( !::SetWindowPos(GetHwnd(),
{
if ( !m_frozenness++ )
{
- SendSetRedraw(GetHwnd(), false);
+ if ( IsShown() )
+ SendSetRedraw(GetHwnd(), false);
}
}
if ( !--m_frozenness )
{
- SendSetRedraw(GetHwnd(), true);
+ if ( IsShown() )
+ {
+ SendSetRedraw(GetHwnd(), true);
- // we need to refresh everything or otherwise he invalidated area is not
- // repainted
- Refresh();
+ // we need to refresh everything or otherwise the invalidated area
+ // is not going to be repainted
+ Refresh();
+ }
}
}
HWND hWnd = GetHwnd();
if ( hWnd )
{
+ RECT mswRect;
+ const RECT *pRect;
if ( rect )
{
- RECT mswRect;
mswRect.left = rect->x;
mswRect.top = rect->y;
mswRect.right = rect->x + rect->width;
mswRect.bottom = rect->y + rect->height;
- ::InvalidateRect(hWnd, &mswRect, eraseBack);
+ pRect = &mswRect;
}
else
- ::InvalidateRect(hWnd, NULL, eraseBack);
+ {
+ pRect = NULL;
+ }
+
+ UINT flags = RDW_INVALIDATE | RDW_ALLCHILDREN;
+ if ( eraseBack )
+ flags |= RDW_ERASE;
+
+ ::RedrawWindow(hWnd, pRect, NULL, flags);
}
}
// if our parent had prepared a defer window handle for us, use it (unless
// we are a top level window)
wxWindowMSW *parent = GetParent();
- HDWP hdwp = (parent && !IsTopLevel()) ? (HDWP)parent->m_hDWP : NULL;
+ HDWP hdwp = parent && !IsTopLevel() ? (HDWP)parent->m_hDWP : NULL;
if ( hdwp )
{
hdwp = ::DeferWindowPos(hdwp, GetHwnd(), NULL,
- x, y, width, height,
- SWP_NOZORDER);
+ x, y, width, height,
+ SWP_NOZORDER);
if ( !hdwp )
{
wxLogLastError(_T("DeferWindowPos"));