@@ -126,7 +126,7 @@ gdigrab_region_wnd_init(AVFormatContext *s1, struct gdigrab *gdigrab)
HRGN region_interior = NULL;
DWORD style = WS_POPUP | WS_VISIBLE;
- DWORD ex = WS_EX_TOOLWINDOW | WS_EX_TOPMOST | WS_EX_TRANSPARENT;
+ DWORD ex = WS_EX_TOOLWINDOW | WS_EX_TOPMOST | WS_EX_LAYERED | WS_EX_TRANSPARENT;
rect.left -= REGION_WND_BORDER; rect.top -= REGION_WND_BORDER;
rect.right += REGION_WND_BORDER; rect.bottom += REGION_WND_BORDER;
@@ -143,6 +143,9 @@ gdigrab_region_wnd_init(AVFormatContext *s1, struct gdigrab *gdigrab)
goto error;
}
+ // Set the window transparency to 255 (opaque)
+ SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA);
+
// Set the window shape to only include the border area
GetClientRect(hwnd, &rect);
region = CreateRectRgn(0, 0,