Desktop DC with transparent windows
-
I work on a program that involves zooming areas under the mouse cursor from the desktop window. I capture the DC of the desktop using GetDesktopWindow() and GetWindowDC(). The problem is that when their exist a transparent window (WS_EX_LAYERED and any alpha level less than 255) under the cursor, the window does not appear in the DC and instead the windows below it appear as if does not exit. Below is general view of my code:
HDC hDeskDC; HWND hDeskTop = GetDesktopWindow(); hDeskDC = GetWindowDC(hDeskTop); HDC hTempDC; //hWnd is a static control I blit the desktop dc onto hTempDC = GetDC(hWnd); //point is the mouse coordinates StretchBlt(hTempDC, 0, 0, 49, 49, hDeskDC, point.x - 3, point.y - 3, 7, 7, SRCCOPY); . . . ReleaseDC(hDeskTop, hDeskDC);
I need to know how to get the desktop DC including any transparent windows on it. Some programs do it like the Accessability Magnifier comes with Win2k and WinXP.