diff --git a/nvdaHelper/remote/gdiHooks.cpp b/nvdaHelper/remote/gdiHooks.cpp index 7656189..fbd849b 100644 --- a/nvdaHelper/remote/gdiHooks.cpp +++ b/nvdaHelper/remote/gdiHooks.cpp @@ -546,7 +546,10 @@ template int WINAPI hookClass_TextOut::fakeFunctio UINT textAlign=GetTextAlign(hdc); POINT pos={x,y}; if(textAlign&TA_UPDATECP) GetCurrentPositionEx(hdc,&pos); - COLORREF prevColor = GetPixel(hdc, x, y); + COLORREF prevColor = CLR_INVALID; + if (GetBkMode(hdc) == TRANSPARENT) { + prevColor = GetPixel(hdc, x, y); + } //Call the real function BOOL res; { @@ -730,7 +733,10 @@ template BOOL __stdcall hookClass_ExtTextOut::fakeF UINT textAlign=GetTextAlign(hdc); POINT pos={x,y}; if(textAlign&TA_UPDATECP) GetCurrentPositionEx(hdc,&pos); - COLORREF prevColor = GetPixel(hdc, x, y); + COLORREF prevColor = CLR_INVALID; + if (GetBkMode(hdc) == TRANSPARENT) { + prevColor = GetPixel(hdc, x, y); + } //Call the real function BOOL res; {