From 6dfbda58e802d25ed51f952e29faa658ffbbcef5 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Fri, 4 Apr 2014 14:59:19 +0000 Subject: [PATCH] [User32] - Add more to GetInsideRect NC. - Sync port from wine with modifications. svn path=/trunk/; revision=62611 --- reactos/win32ss/user/user32/windows/defwnd.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/reactos/win32ss/user/user32/windows/defwnd.c b/reactos/win32ss/user/user32/windows/defwnd.c index b15d15ba3ce..7794329ff20 100644 --- a/reactos/win32ss/user/user32/windows/defwnd.c +++ b/reactos/win32ss/user/user32/windows/defwnd.c @@ -123,15 +123,13 @@ UserGetInsideRectNC(PWND Wnd, RECT *rect) /* Remove frame from rectangle */ if (UserHasThickFrameStyle(Style, ExStyle )) { - InflateRect(rect, -GetSystemMetrics(SM_CXFRAME), - -GetSystemMetrics(SM_CYFRAME)); + InflateRect(rect, -GetSystemMetrics(SM_CXFRAME), -GetSystemMetrics(SM_CYFRAME)); } else { if (UserHasDlgFrameStyle(Style, ExStyle )) { - InflateRect(rect, -GetSystemMetrics(SM_CXDLGFRAME), - -GetSystemMetrics(SM_CYDLGFRAME)); + InflateRect(rect, -GetSystemMetrics(SM_CXDLGFRAME), -GetSystemMetrics(SM_CYDLGFRAME)); /* FIXME: this isn't in NC_AdjustRect? why not? */ if (ExStyle & WS_EX_DLGMODALFRAME) InflateRect( rect, -1, 0 ); @@ -140,11 +138,19 @@ UserGetInsideRectNC(PWND Wnd, RECT *rect) { if (UserHasThinFrameStyle(Style, ExStyle)) { - InflateRect(rect, -GetSystemMetrics(SM_CXBORDER), - -GetSystemMetrics(SM_CYBORDER)); + InflateRect(rect, -GetSystemMetrics(SM_CXBORDER), -GetSystemMetrics(SM_CYBORDER)); } } } + /* We have additional border information if the window + * is a child (but not an MDI child) */ + if ((Style & WS_CHILD) && !(ExStyle & WS_EX_MDICHILD)) + { + if (ExStyle & WS_EX_CLIENTEDGE) + InflateRect (rect, -GetSystemMetrics(SM_CXEDGE), -GetSystemMetrics(SM_CYEDGE)); + if (ExStyle & WS_EX_STATICEDGE) + InflateRect (rect, -GetSystemMetrics(SM_CXBORDER), -GetSystemMetrics(SM_CYBORDER)); + } } @@ -1086,7 +1092,6 @@ DefWndScreenshot(HWND hWnd) ReleaseDC(hWnd, hdc2); CloseClipboard(); - }