diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2019-06-30 12:48:57 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2019-06-30 12:48:57 +0200 |
| commit | fe078af239f3b73651c32bb1cdb158dcab39ad5c (patch) | |
| tree | c855620ab6970e658ea662d2c36b81cb68f50992 /alf/alfcompat.cpp | |
| parent | ecfb4b72fec0c25ef416038ef22db5d34d687ee4 (diff) | |
label reimplement
Diffstat (limited to 'alf/alfcompat.cpp')
| -rw-r--r-- | alf/alfcompat.cpp | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/alf/alfcompat.cpp b/alf/alfcompat.cpp index 3895545..8672bb8 100644 --- a/alf/alfcompat.cpp +++ b/alf/alfcompat.cpp @@ -260,11 +260,44 @@ ALF_Compat_fallbackIsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPar static HRESULT WINAPI ALF_Compat_fallbackDrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc) { - (void)hwnd; - (void)hdc; - (void)prc; + HWND parent = GetParent(hwnd); + if (!parent) + return E_NOTIMPL; + + RECT rc; + if (prc) { + rc = *prc; + } else { + GetClientRect(hwnd, &rc); + } + MapWindowRect(hwnd, parent, &rc); - return E_NOTIMPL; + RECT childr; + GetClientRect(hwnd, &childr); + MapWindowRect(hwnd, parent, &childr); + + POINT o; + OffsetViewportOrgEx(hdc, -childr.left, -childr.top, &o); + + HRGN oldClipRgn = CreateRectRgn(0, 0, 0, 0); + if (!GetClipRgn(hdc, oldClipRgn)) { + DeleteObject(oldClipRgn); + oldClipRgn = NULL; + } + + IntersectClipRect(hdc, rc.left, rc.top, rc.right, rc.bottom); + + SendMessage(parent, WM_ERASEBKGND, (WPARAM)hdc, 0); + SendMessage(parent, WM_PRINTCLIENT, (WPARAM)hdc, (LPARAM)PRF_CLIENT); + + SelectClipRgn(hdc, oldClipRgn); + if (oldClipRgn) { + DeleteObject(oldClipRgn); + } + + SetViewportOrgEx(hdc, o.x, o.y, NULL); + + return S_OK; } static HRESULT WINAPI |
