diff --git a/base/applications/mspaint/winproc.cpp b/base/applications/mspaint/winproc.cpp index 640e596215b..779db8ff51d 100644 --- a/base/applications/mspaint/winproc.cpp +++ b/base/applications/mspaint/winproc.cpp @@ -72,17 +72,18 @@ void CMainWindow::alignChildrenToMainWindow() h = clientRect.bottom - 3; } - RECT statusBarRect0; - int statusBarBorders[3]; - if (::IsWindow(hStatusBar)) + INT statusBarHeight = 0; + if (::IsWindowVisible(hStatusBar)) { - ::SendMessage(hStatusBar, SB_GETRECT, 0, (LPARAM)&statusBarRect0); - ::SendMessage(hStatusBar, SB_GETBORDERS, 0, (LPARAM)&statusBarBorders); + RECT Rect; + INT borders[3]; + ::SendMessage(hStatusBar, SB_GETRECT, 0, (LPARAM)&Rect); + ::SendMessage(hStatusBar, SB_GETBORDERS, 0, (LPARAM)&borders); + statusBarHeight = Rect.bottom - Rect.top + borders[1]; } - int statusBarHeight = statusBarRect0.bottom - statusBarRect0.top + statusBarBorders[1]; if (scrollboxWindow.IsWindow()) - scrollboxWindow.MoveWindow(x, y, w, ::IsWindowVisible(hStatusBar) ? h - statusBarHeight : h, TRUE); + scrollboxWindow.MoveWindow(x, y, w, h - statusBarHeight, TRUE); if (paletteWindow.IsWindow()) paletteWindow.MoveWindow(x, 9, 255, 32, TRUE); }