OSDN Git Service

gdiHooks's fake_StretchBlt: KMPlayer seems to place a graphic over the top of its...
authorMichael Curran <mick@kulgan.net>
Wed, 20 Feb 2013 00:26:07 +0000 (10:26 +1000)
committerMichael Curran <mick@kulgan.net>
Wed, 20 Feb 2013 00:26:07 +0000 (10:26 +1000)
nvdaHelper/remote/gdiHooks.cpp

index ad06d89..96caeab 100644 (file)
@@ -739,6 +739,13 @@ BOOL WINAPI fake_StretchBlt(HDC hdcDest, int nXDest, int nYDest, int nWidthDest,
        //Call the real StretchBlt\r
        BOOL res=real_StretchBlt(hdcDest,nXDest,nYDest,nWidthDest,nHeightDest,hdcSrc,nXSrc,nYSrc,nWidthSrc,nHeightSrc,dwRop);\r
        if(!res) return res;\r
+       //#2989: KMPlayer uses stretchBlt with SRCCOPY  to place a graphic over the top of its menu items replacing the real text.\r
+       //Therefore at the moment don't allow stretchBlt SRCCOPY to clear previous text -- change it to SRCAND if blitting directly to a menu window\r
+       HWND hwnd=NULL;\r
+       wchar_t className[7]; \r
+       if(hdcDest&&dwRop==SRCCOPY&&(hwnd=WindowFromDC(hdcDest))&&GetClassName(hwnd,className,sizeof(className))>0&&wcscmp(className,L"#32768")==0) {\r
+               dwRop=SRCAND;\r
+       }\r
        StretchBlt_helper(hdcDest, nXDest, nYDest, nWidthDest, nHeightDest, hdcSrc, nXSrc, nYSrc, nWidthSrc, nHeightSrc, dwRop);\r
        return res;\r
 }\r