diff --git a/reactos/win32ss/user/ntuser/defwnd.c b/reactos/win32ss/user/ntuser/defwnd.c index 72b09e74eb2..987dbb822ce 100644 --- a/reactos/win32ss/user/ntuser/defwnd.c +++ b/reactos/win32ss/user/ntuser/defwnd.c @@ -415,6 +415,7 @@ UserPaintCaption(PWND pWnd, INT Flags) * RealUserDrawCaption in order to draw the classic caption when themes * are disabled but the themes service is enabled */ + TRACE("UDCB Flags %08x\n"); co_IntSendMessage(UserHMGetHandle(pWnd), WM_NCUAHDRAWCAPTION, Flags, 0); } else @@ -463,7 +464,7 @@ DefWndSetIcon(PWND pWnd, WPARAM wParam, LPARAM lParam) IntSetProp(pWnd, gpsi->atomIconSmProp, hIconSmall); if ((pWnd->style & WS_CAPTION ) == WS_CAPTION) - UserPaintCaption(pWnd, DC_CAPTION); + UserPaintCaption(pWnd, DC_ICON); return (LRESULT)hIconOld; } diff --git a/reactos/win32ss/user/ntuser/nonclient.c b/reactos/win32ss/user/ntuser/nonclient.c index 129a13991d0..325c17b9523 100644 --- a/reactos/win32ss/user/ntuser/nonclient.c +++ b/reactos/win32ss/user/ntuser/nonclient.c @@ -930,6 +930,8 @@ VOID UserDrawCaptionBar( { TempRect = CurrentRect; + Flags |= DC_TEXT|DC_BUTTONS; // Icon will be checked if not already set. + if (UserSystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &Gradient, 0) && Gradient) { Flags |= DC_GRADIENT; @@ -1039,9 +1041,10 @@ NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags) { Active = (gpqForeground == pWnd->head.pti->MessageQueue); } - Flags = DC_NC; } + Flags = DC_NC; // Redraw everything! + IntGetWindowRect(pWnd, &WindowRect); CurrentRect.top = CurrentRect.left = 0; @@ -1112,14 +1115,6 @@ NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags) CurrentRect.top += UserGetSystemMetrics(SM_CYCAPTION); } - if (!(Flags & DC_ICON) && - (Style & WS_SYSMENU) && - !(Flags & DC_SMALLCAP) && - !(ExStyle & WS_EX_DLGMODALFRAME) && - !(ExStyle & WS_EX_TOOLWINDOW) ) - { - pIcon = NC_IconForWindow(pWnd); // Force redraw of caption with icon if DC_ICON not flaged.... - } UserDrawCaption(pWnd, hDC, &TempRect, NULL, pIcon ? UserHMGetHandle(pIcon) : NULL, NULL, Flags); /* Draw buttons */ @@ -1409,7 +1404,7 @@ LRESULT NC_HandleNCActivate( PWND Wnd, WPARAM wParam, LPARAM lParam ) } else { - Wnd->state &= ~(WNDS_ACTIVEFRAME|WNDS_HASCAPTION); + Wnd->state &= ~WNDS_ACTIVEFRAME; wParam = DC_CAPTION; }