HDC hdc, hdcTemp; RECT rect; BYTE* bitPointer; int x, y; int red, green, blue, alpha; while(true) { hdc = GetDC(HWND_DESKTOP); GetWindowRect(hWND_Desktop, &rect); int MAX_WIDTH = rect.right; int MAX_HEIGHT = rect.bottom; hdcTemp = CreateCompatibleDC(…