Commit 34dd3260 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/propsheet: Only use header bitmap when asked for it.

parent 6eafebed
...@@ -3205,15 +3205,17 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) ...@@ -3205,15 +3205,17 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
COLORREF clrOld = 0; COLORREF clrOld = 0;
int oldBkMode = 0; int oldBkMode = 0;
hbmp = SelectObject(hdcSrc, psInfo->ppshheader.u5.hbmHeader);
hOldFont = SelectObject(hdc, psInfo->hFontBold);
GetClientRect(hwndLineHeader, &r); GetClientRect(hwndLineHeader, &r);
MapWindowPoints(hwndLineHeader, hwnd, (LPPOINT) &r, 2); MapWindowPoints(hwndLineHeader, hwnd, (LPPOINT) &r, 2);
SetRect(&rzone, 0, 0, r.right + 1, r.top - 1); SetRect(&rzone, 0, 0, r.right + 1, r.top - 1);
GetObjectW(psInfo->ppshheader.u5.hbmHeader, sizeof(BITMAP), &bm); hOldFont = SelectObject(hdc, psInfo->hFontBold);
if (psInfo->ppshheader.dwFlags & PSH_USEHBMHEADER)
{
hbmp = SelectObject(hdcSrc, psInfo->ppshheader.u5.hbmHeader);
GetObjectW(psInfo->ppshheader.u5.hbmHeader, sizeof(BITMAP), &bm);
if (psInfo->ppshheader.dwFlags & PSH_WIZARD97_OLD) if (psInfo->ppshheader.dwFlags & PSH_WIZARD97_OLD)
{ {
/* Fill the unoccupied part of the header with color of the /* Fill the unoccupied part of the header with color of the
...@@ -3238,8 +3240,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) ...@@ -3238,8 +3240,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
} }
/* Draw the header itself. */ /* Draw the header itself. */
BitBlt(hdc, 0, 0, BitBlt(hdc, 0, 0, bm.bmWidth, min(bm.bmHeight, rzone.bottom),
bm.bmWidth, min(bm.bmHeight, rzone.bottom),
hdcSrc, 0, 0, SRCCOPY); hdcSrc, 0, 0, SRCCOPY);
} }
else else
...@@ -3261,6 +3262,9 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) ...@@ -3261,6 +3262,9 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
* replicate it. */ * replicate it. */
} }
SelectObject(hdcSrc, hbmp);
}
clrOld = SetTextColor (hdc, 0x00000000); clrOld = SetTextColor (hdc, 0x00000000);
oldBkMode = SetBkMode (hdc, TRANSPARENT); oldBkMode = SetBkMode (hdc, TRANSPARENT);
...@@ -3300,7 +3304,6 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) ...@@ -3300,7 +3304,6 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
SetTextColor(hdc, clrOld); SetTextColor(hdc, clrOld);
SetBkMode(hdc, oldBkMode); SetBkMode(hdc, oldBkMode);
SelectObject(hdc, hOldFont); SelectObject(hdc, hOldFont);
SelectObject(hdcSrc, hbmp);
} }
if ( (ppshpage && (ppshpage->dwFlags & PSP_HIDEHEADER)) && if ( (ppshpage && (ppshpage->dwFlags & PSP_HIDEHEADER)) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment