[MSPAINT]
authorBenedikt Freisen <b.freisen@gmx.net>
Wed, 24 May 2017 19:31:43 +0000 (19:31 +0000)
committerBenedikt Freisen <b.freisen@gmx.net>
Wed, 24 May 2017 19:31:43 +0000 (19:31 +0000)
- Determine and adapt to actual status bar height instead of assuming a fixed height.  This improves theme support.

svn path=/trunk/; revision=74642

reactos/base/applications/mspaint/winproc.cpp

index 2e2ab63..e35f93e 100644 (file)
@@ -66,7 +66,13 @@ void CMainWindow::alignChildrenToMainWindow()
         h = clientRect.bottom - 3;
     }
 
-    scrollboxWindow.MoveWindow(x, y, w, ::IsWindowVisible(hStatusBar) ? h - 23 : h, TRUE);
+    RECT statusBarRect0;
+    SendMessage(hStatusBar, SB_GETRECT, 0, (LPARAM)&statusBarRect0);
+    int statusBarBorders[3];
+    SendMessage(hStatusBar, SB_GETBORDERS, 0, (LPARAM)&statusBarBorders);
+    int statusBarHeight = statusBarRect0.bottom - statusBarRect0.top + statusBarBorders[1];
+
+    scrollboxWindow.MoveWindow(x, y, w, ::IsWindowVisible(hStatusBar) ? h - statusBarHeight : h, TRUE);
     paletteWindow.MoveWindow(x, 9, 255, 32, TRUE);
 }