Index: dll/win32/uxtheme/nonclient.c =================================================================== --- dll/win32/uxtheme/nonclient.c (revision 75430) +++ dll/win32/uxtheme/nonclient.c (working copy) @@ -298,7 +306,8 @@ static void ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext, CAPTIONBUTTON buttonId, - INT iStateId) + INT iStateId, + RECT* rcButtons) { INT iPartId; PWND_DATA pwndData = ThemeGetWndData(pcontext->hWnd); @@ -341,6 +350,24 @@ } DrawThemeBackground(pcontext->theme, pcontext->hDC, iPartId, iStateId, &pwndData->rcCaptionButtons[buttonId], NULL); + + if (!rcButtons) + return; + if (rcButtons->left == 0 && rcButtons->top == 0 && rcButtons->right == 0 && rcButtons->bottom == 0) + { + *rcButtons = pwndData->rcCaptionButtons[buttonId]; + } + else + { + if (pwndData->rcCaptionButtons[buttonId].left < rcButtons->left) + rcButtons->left = pwndData->rcCaptionButtons[buttonId].left; + if (pwndData->rcCaptionButtons[buttonId].top < rcButtons->top) + rcButtons->top = pwndData->rcCaptionButtons[buttonId].top; + if (pwndData->rcCaptionButtons[buttonId].right > rcButtons->right) + rcButtons->right = pwndData->rcCaptionButtons[buttonId].right; + if (pwndData->rcCaptionButtons[buttonId].bottom > rcButtons->bottom) + rcButtons->bottom = pwndData->rcCaptionButtons[buttonId].bottom; + } } static DWORD @@ -362,13 +389,13 @@ { /* Draw the buttons */ ThemeDrawCaptionButton(pcontext, CLOSEBUTTON, - ThemeGetButtonState(HTCLOSE, htHot, htDown, pcontext->Active)); + ThemeGetButtonState(HTCLOSE, htHot, htDown, pcontext->Active), NULL); ThemeDrawCaptionButton(pcontext, MAXBUTTON, - ThemeGetButtonState(HTMAXBUTTON, htHot, htDown, pcontext->Active)); + ThemeGetButtonState(HTMAXBUTTON, htHot, htDown, pcontext->Active), NULL); ThemeDrawCaptionButton(pcontext, MINBUTTON, - ThemeGetButtonState(HTMINBUTTON, htHot, htDown, pcontext->Active)); + ThemeGetButtonState(HTMINBUTTON, htHot, htDown, pcontext->Active), NULL); ThemeDrawCaptionButton(pcontext, HELPBUTTON, - ThemeGetButtonState(HTHELP, htHot, htDown, pcontext->Active)); + ThemeGetButtonState(HTHELP, htHot, htDown, pcontext->Active), NULL); } /* Used from WM_NCPAINT and WM_NCACTIVATE handlers */ @@ -375,7 +402,7 @@ static void ThemeDrawCaption(PDRAW_CONTEXT pcontext, RECT* prcCurrent) { - RECT rcPart; + RECT rcPart, rcButtons; int iPart, iState; HICON hIcon; @@ -409,15 +436,18 @@ -(int)pcontext->wi.cyWindowBorders-BUTTON_GAP_SIZE); /* Draw the caption buttons */ + SetRect(&rcButtons, 0, 0, 0, 0); if (pcontext->wi.dwStyle & WS_SYSMENU) { iState = pcontext->Active ? BUTTON_NORMAL : BUTTON_INACTIVE; - ThemeDrawCaptionButton(pcontext, CLOSEBUTTON, iState); - ThemeDrawCaptionButton(pcontext, MAXBUTTON, iState); - ThemeDrawCaptionButton(pcontext, MINBUTTON, iState); - ThemeDrawCaptionButton(pcontext, HELPBUTTON, iState); + ThemeDrawCaptionButton(pcontext, CLOSEBUTTON, iState, &rcButtons); + ThemeDrawCaptionButton(pcontext, MAXBUTTON, iState, &rcButtons); + ThemeDrawCaptionButton(pcontext, MINBUTTON, iState, &rcButtons); + ThemeDrawCaptionButton(pcontext, HELPBUTTON, iState, &rcButtons); } + + rcPart.right -= rcButtons.right - rcButtons.left + 4; rcPart.top += 3 ; @@ -430,8 +460,6 @@ rcPart.left += IconWidth + 4; } - rcPart.right -= 4; - /* Draw the caption */ ThemeDrawCaptionText(pcontext, &rcPart, iPart, iState); }