How to keep a window off a screen share on Windows
Updated June 2026 · Technical
The short answer: display affinity
Windows has a built-in way to mark a window as “don't capture this.” A program calls the SetWindowDisplayAffinity function with the flag WDA_EXCLUDEFROMCAPTURE. From that point on, the Windows compositor still draws the window on your physical monitor, but it hands back blank pixels to anything trying to record or share the screen. The window is fully visible to you and effectively invisible to the capture.
This is the same mechanism PocketPhantom uses to keep its AI answer overlay off screen shares. It is an operating-system feature, not a trick layered on top of one — which is why it is reliable across so many different capture tools.
What WDA_EXCLUDEFROMCAPTURE actually does
The flag was introduced in Windows 10 version 2004 (May 2020) and works on Windows 10 and 11. An older value, WDA_MONITOR, blanked the window in captures too, but it painted a black rectangle in its place. WDA_EXCLUDEFROMCAPTURE is cleaner: the capture simply receives the content behind the window, as if it were not there at all. No black box, no tell-tale gap.
Because the exclusion happens inside the Desktop Window Manager — the part of Windows that composes what each surface sees — it applies no matter which application is doing the capturing. The capturing app never gets the option to “see through” the exclusion; the pixels were never offered to it.
What it hides the window from
The exclusion covers the standard ways Windows hands a screen to another program:
- Meeting and call apps — Microsoft Teams, Zoom, Google Meet, Discord and similar tools that use the Windows.Graphics.Capture API.
- Recorders and streamers — OBS Studio, NVIDIA ShadowPlay, and the Xbox Game Bar, which use DXGI Desktop Duplication or NvFBC.
- Screenshots — the PrtScn key, the Snipping Tool, and the classic
BitBltscreenshot path.
In every one of those cases the other side sees your ordinary desktop and the excluded window is simply absent.
What it can't hide from
Display affinity is a software exclusion at the OS layer, so it stops at the edges of that layer. It is honest to know where it ends:
- A second camera. A phone or webcam physically pointed at your monitor records light, not pixels, so the flag has no effect on it.
- Hardware capture. An external HDMI capture card or a KVM that splits the video signal sits below the operating system and is unaffected.
- The same machine, different user-space tricks. Some specialised accessibility or remote-control stacks read the screen through paths that may behave differently.
In other words, it reliably keeps a window out of captures made on that PC by ordinary software. It is not a defence against someone filming the screen with another device. Read is a screen-share AI assistant detectable? for the fuller picture.
Build it yourself, or use a tool that already has
If you write desktop software, you can call SetWindowDisplayAffinity on your own window handle — it is a single Win32 call. The harder part is everything around it: an overlay that reads your screen, talks to an AI model, and surfaces an answer without showing up in Alt-Tab or the taskbar.
That is what PocketPhantom is — an invisible AI assistant for Windows that uses this exact exclusion, with hosted AI included so it works the moment you install it. You can download it for Windows or read the setup guide first.
Frequently asked questions
Does WDA_EXCLUDEFROMCAPTURE work on Windows 11?
Yes. It works on Windows 10 version 2004 and later, and on all of Windows 11. PocketPhantom supports Windows 10 and 11, 64-bit.
Will the hidden window show up as a black box?
No. WDA_EXCLUDEFROMCAPTURE returns the content behind the window, so there is no black rectangle. The older WDA_MONITOR flag did leave a black box; the newer flag does not.
Can a screen recording still pick up the window?
Not if the recorder uses standard Windows capture APIs, which OBS, ShadowPlay, Game Bar, Teams, Zoom, and Meet all do. A second camera pointed at the monitor or an external HDMI capture card is a different story, because those capture light or the raw video signal rather than the desktop.
Is hiding a window from capture the same as hiding the program?
No. Display affinity only controls what screen captures see. Hiding the program from Alt-Tab, the taskbar, and task switchers is separate work the application has to do itself.