diff --git a/DDrawCompat/Gdi/Dc.cpp b/DDrawCompat/Gdi/Dc.cpp index e8864e7..1cc1c38 100644 --- a/DDrawCompat/Gdi/Dc.cpp +++ b/DDrawCompat/Gdi/Dc.cpp @@ -90,7 +90,7 @@ namespace POINT brushOrg = {}; GetBrushOrgEx(origDc, &brushOrg); - SetBrushOrgEx(compatDc.dc, brushOrg.x, brushOrg.y, nullptr); + SetBrushOrgEx(compatDc.dc, origin.x + brushOrg.x, origin.y + brushOrg.y, nullptr); POINT currentPos = {}; GetCurrentPositionEx(origDc, ¤tPos); diff --git a/DDrawCompat/Gdi/User32WndProcs.cpp b/DDrawCompat/Gdi/User32WndProcs.cpp index 13ec07d..236b897 100644 --- a/DDrawCompat/Gdi/User32WndProcs.cpp +++ b/DDrawCompat/Gdi/User32WndProcs.cpp @@ -156,6 +156,19 @@ namespace } break; + case WM_ERASEBKGND: + { + HBRUSH brush = reinterpret_cast(GetClassLong(hwnd, GCL_HBRBACKGROUND)); + if (!brush) + { + return FALSE; + } + RECT rect = {}; + GetClientRect(hwnd, &rect); + FillRect(Gdi::CompatDc(reinterpret_cast(wParam)), &rect, brush); + return TRUE; + } + case WM_NCACTIVATE: return onNcActivate(hwnd, wParam, lParam);