Chameleon Logo Chameleon
Deep Dives 9 min read • 2026-09-17

Windows Desktop Window Manager (DWM) & WDA_EXCLUDEFROMCAPTURE: Complete Architectural Breakdown

Comprehensive engineering breakdown of Windows DWM capture exclusion. Understand SetWindowDisplayAffinity, DirectX swapchains, and capture surfaces.

C
Chameleon Research Lab VERIFIED

On Windows, the Desktop Window Manager (DWM.exe) is responsible for composing every visible window into the primary desktop frame. Exploring how DWM implements display affinity reveals why excluded windows are completely private to screen share capture.

Evolution of Windows Display Affinity: From WDA_MONITOR to WDA_EXCLUDEFROMCAPTURE

Originally created to protect HDCP copyright content, SetWindowDisplayAffinity accepted WDA_NONE (0x00) and WDA_MONITOR (0x01). However, WDA_MONITOR caused video feeds to display an obvious black square.

Microsoft resolved this in Windows 10 Build 19041 (Version 2004) by adding WDA_EXCLUDEFROMCAPTURE (0x11). Under this flag, DWM modifies the render tree:

BOOL result = SetWindowDisplayAffinity(hWnd, 0x00000011);

DirectX Swapchains & DWM Composition Pipeline

Every modern Windows desktop application presents rendered UI frames into a DirectX (DXGI) Swapchain. DWM takes these textures and compiles the final frame sent to the display adapter.

Desktop Duplication API (DXGI) Behavior Under WDA_EXCLUDEFROMCAPTURE

When Zoom or Teams calls IDXGIOutputDuplication::AcquireNextFrame, DWM provides a capture surface from which all windows with display affinity exclusion have already been pruned.

Handling Windows 10 vs. Windows 11 Kernel Differences

Windows 11 features optimizations in dwmcore.dll that ensure rounded window corners and drop shadows are also cleanly excluded without rendering halos.

Frequently Asked Questions

Why did older versions of SetWindowDisplayAffinity create black boxes?
WDA_MONITOR replaced window contents with black pixels to prevent DRM piracy. Windows 10 build 2004 introduced WDA_EXCLUDEFROMCAPTURE (0x11), which removes the window completely rather than filling it with black.
Can administrative applications exclude WDA_EXCLUDEFROMCAPTURE?
Only Ring-0 kernel drivers or specialized graphics debugging tools can inspect raw compositor backbuffers. User-space apps like Zoom or Teams cannot exclude this OS barrier.