1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

Disabled the VirtualizeDesktopPainting shim

This commit is contained in:
narzoul 2016-05-21 11:26:55 +02:00
parent f973291f93
commit b78ea774d7
2 changed files with 15 additions and 1 deletions

View File

@ -124,6 +124,11 @@ namespace
void setClippingRegion(HDC compatDc, HDC origDc, HWND hwnd, bool isMenuWindow, const POINT& origin)
{
if (GetDesktopWindow() == hwnd)
{
return;
}
HRGN clipRgn = CreateRectRgn(0, 0, 0, 0);
if (1 == GetClipRgn(origDc, clipRgn))
{
@ -167,7 +172,7 @@ namespace CompatGdiDc
return it->second.dc;
}
const HWND hwnd = WindowFromDC(origDc);
const HWND hwnd = CALL_ORIG_FUNC(WindowFromDC)(origDc);
const bool isMenuWindow = hwnd && 0x8000 == GetClassLongPtr(hwnd, GCW_ATOM);
if (isMenuWindow && !isMenuPaintDc)
{

View File

@ -83,6 +83,15 @@ namespace
LRESULT WINAPI defWindowProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (WM_CREATE == msg)
{
auto className = reinterpret_cast<CREATESTRUCTW*>(lParam)->lpszClass;
if (reinterpret_cast<DWORD>(className) > 0xFFFF &&
0 == lstrcmpW(className, L"CompatWindowDesktopReplacement"))
{
return -1;
}
}
return defPaintProc(hwnd, msg, wParam, lParam, CALL_ORIG_FUNC(DefWindowProcW), "defWindowProcW");
}