From eaef5b9f37194508ed00c0e3b72659ba74bfd5b2 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 7 Jul 2016 15:21:54 +0000 Subject: [PATCH] [NtUser] - Patch by Victor Matovykh : Cleanup and optimization. See CORE-11479. svn path=/trunk/; revision=71846 --- reactos/win32ss/user/ntuser/nonclient.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/reactos/win32ss/user/ntuser/nonclient.c b/reactos/win32ss/user/ntuser/nonclient.c index a7c3ba61769..ace470bec19 100644 --- a/reactos/win32ss/user/ntuser/nonclient.c +++ b/reactos/win32ss/user/ntuser/nonclient.c @@ -943,13 +943,10 @@ VOID UserDrawCaptionBar( if (!(Style & WS_MINIMIZE)) { - PMENU menu = UserGetMenuObject(UlongToHandle(pWnd->IDMenu)); /* Draw menu bar */ - if ( menu && (((Style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) ) + if (HAS_MENU(pWnd, Style)) { - TempRect = CurrentRect; - TempRect.bottom = TempRect.top + menu->cyMenu; - CurrentRect.top += MENU_DrawMenuBar(hDC, &TempRect, pWnd, FALSE); + CurrentRect.top += MENU_DrawMenuBar(hDC, &CurrentRect, pWnd, FALSE); } if (ExStyle & WS_EX_CLIENTEDGE) @@ -1112,13 +1109,13 @@ NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags) if (!(Style & WS_MINIMIZE)) { - PMENU menu = UserGetMenuObject(UlongToHandle(pWnd->IDMenu)); /* Draw menu bar */ - if ( menu && (((Style) & (WS_CHILD | WS_POPUP)) != WS_CHILD) ) + if (HAS_MENU(pWnd, Style)) { - TempRect = CurrentRect; - TempRect.bottom = TempRect.top + menu->cyMenu; - if (!(Flags & DC_NOSENDMSG)) CurrentRect.top += MENU_DrawMenuBar(hDC, &TempRect, pWnd, FALSE); + if (!(Flags & DC_NOSENDMSG)) + { + CurrentRect.top += MENU_DrawMenuBar(hDC, &CurrentRect, pWnd, FALSE); + } } if (ExStyle & WS_EX_CLIENTEDGE) @@ -1219,7 +1216,7 @@ LRESULT NC_HandleNCCalcSize( PWND Wnd, WPARAM wparam, RECTL *Rect, BOOL Suspende Rect->top += UserGetSystemMetrics(SM_CYCAPTION); } - if (Wnd->IDMenu && ((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)) + if (HAS_MENU(Wnd, Style)) { HDC hDC = UserGetDCEx(Wnd, 0, DCX_USESTYLE | DCX_WINDOW); -- 2.17.1