Kopya

How it works

How apps hide a window from screen capture: setContentProtection and WDA_EXCLUDEFROMCAPTURE

Apps hide a window from screen capture by asking the operating system to leave it out. On Windows that is SetWindowDisplayAffinity with WDA_EXCLUDEFROMCAPTURE; on macOS it is NSWindow.sharingType = .none; Electron’s setContentProtection wraps both. Kopya uses it for its answer panel. Microsoft documents the Windows behaviour. Apple calls its flag legacy, so results on macOS vary by OS version and capture tool. Neither is a security boundary.

Last updated · Kopya team

What is screen capture exclusion?

Screen capture exclusion is an operating-system feature that lets an app mark one of its own windows so the system leaves it out of supported screenshots, recordings and screen shares while still drawing it on your display. The app hides nothing itself. It sets a flag, and the OS decides which capture paths honour it.

Kopya is a desktop AI assistant for macOS and Windows that answers questions about what is on your screen when you press a hotkey; its panel is excluded from supported screen shares and recordings. This page is the developer-level account. The product view is on Kopya’s screen recording privacy page, and the screen capture glossary defines each term.

API or flagPlatformWhat capture software gets
WDA_EXCLUDEFROMCAPTUREWindows 10 version 2004+, Windows 11The desktop without the window
WDA_MONITORWindows, including older buildsAn empty window: a blank or black rectangle
NSWindow.sharingType = .nonemacOS (legacy, per Apple)Varies; ScreenCaptureKit-based tools may capture the window
setContentProtection(true)Electron on Windows and macOSWhatever the OS flag underneath delivers

How does SetWindowDisplayAffinity hide a window on Windows?

SetWindowDisplayAffinity is a Win32 function that tells Windows where a window’s contents may be displayed. With the value WDA_EXCLUDEFROMCAPTURE, supported from Windows 10 version 2004 (build 19041), Microsoft’s documentation says the window is shown only on a monitor and appears nowhere else. Capture software receives the desktop without it.

#include <windows.h>

// hwnd: a top-level window that belongs to this process.
BOOL ok = SetWindowDisplayAffinity(hwnd, WDA_EXCLUDEFROMCAPTURE);

// Before Windows 10 version 2004 the same call behaves like WDA_MONITOR:
// captures show an empty window instead of leaving it out.

DWORD affinity = 0;
GetWindowDisplayAffinity(hwnd, &affinity); // other processes can read this too

Microsoft documents the limits:

  • Top-level windows only, and the window must belong to the calling process. An app can exclude its own windows, not another app’s.
  • Only while the Desktop Window Manager (DWM) is composing the desktop.
  • Honoured by a specific set of public OS features and APIs, which Microsoft does not list.

For the user-level view, including checking your build with winver, see hiding a window from screen capture on Windows 10 and 11.

Why does a hidden window show as a black box instead of disappearing?

A black rectangle means WDA_MONITOR is in effect. That older value keeps the window on the monitor but hands capture software an empty window, which shows up blank or black. WDA_EXCLUDEFROMCAPTURE removes the window from the capture altogether. On Windows older than version 2004, asking for the newer value gives the older result.

Frameworks can cause the same symptom: Electron 35.0.1 (March 2025) rendered protected windows opaque black on Windows until versions 35.4.0 and 36.2.1 fixed it. Kopya warns you on builds older than 19041, where its panel may appear as a black rectangle.

What does NSWindow.sharingType = .none do on macOS?

NSWindow.sharingType is an AppKit property that sets how much access other processes have to a window’s contents. The value .none kept a window out of captures made through the older CoreGraphics APIs. Apple’s documentation now calls .none a legacy constant that macOS no longer uses, and says not to use it to hide content from capture.

import AppKit

// Legacy. Apple's documentation says macOS no longer uses this value
// and that it should not be used to hide content from capture.
window.sharingType = .none

An Apple DTS engineer explained in July 2024 that the flag acts at the CGWindow level, while nearly all screen recording and remote-control apps work below the window level, where it has no effect.

ScreenCaptureKit, Apple’s current capture framework, is the path that ignores it. Asked about macOS 15.4 and later, DTS replied in July 2025: “At this time there are no public APIs for preventing screen capture.” A November 2025 thread reports inconsistent results, with QuickTime recording a protected window straight away.

macOS results therefore depend on OS version and capture tool. Hiding an app from screen recording on Mac covers what still works today and the reliable alternatives.

What does Electron’s setContentProtection do?

setContentProtection(true) is Electron’s cross-platform wrapper around both flags. On Windows it calls SetWindowDisplayAffinity with WDA_EXCLUDEFROMCAPTURE; on macOS it sets the window’s sharing type to NSWindowSharingNone. Electron’s documentation covers macOS and Windows only, and warns that Mac apps capturing through ScreenCaptureKit will record the window anyway.

import { BrowserWindow } from "electron";

const panel = new BrowserWindow({ frame: false, transparent: true, alwaysOnTop: true });

// Windows: SetWindowDisplayAffinity(hwnd, WDA_EXCLUDEFROMCAPTURE)
// macOS:   NSWindow.sharingType = NSWindowSharingNone (legacy, see above)
panel.setContentProtection(true);

The warning arrived with docs PR #48290 after issue #48258, where a maintainer reproduced the capture with native macOS screen recording. Kopya calls this one method, on its answer panel only. It is on by default on every plan, including the free one, and ⌘⇧P (macOS) or Ctrl+Shift+P (Windows) switches it.

Is capture exclusion a security feature or DRM?

No. Microsoft states that display affinity is not a security feature or DRM, and that nothing stops someone photographing the screen. Its Azure Virtual Desktop documentation makes the same point: its screen capture protection is not DRM-level. Capture exclusion prevents accidental disclosure. It does not stop a determined observer.

It does not cover:

  • A phone or camera pointed at the screen, a person looking at it, or a projector or mirrored display.
  • The rest of Kopya: the menu-bar or tray icon, its menu and the sign-in window are not excluded from capture.
  • The running process in Task Manager or Activity Monitor, or what monitoring and endpoint software can observe.
  • Code already running on the computer: security researchers have reported clearing the flag from another process in the same session.
  • Protected video, where Apple points developers to FairPlay Streaming instead.

Can other software tell that a window is excluded from capture?

Yes. On Windows, the companion function GetWindowDisplayAffinity returns a window’s current affinity, and Microsoft documents that any process can call it. The window also stays an ordinary window owned by a running process. Capture exclusion changes what a capture contains. It does not conceal that the app exists or that the flag is set.

That is why Kopya says “excluded from capture” and nothing stronger; see what an invisible AI overlay is, and its limits.

Which mainstream apps use capture exclusion?

Capture exclusion is a mainstream OS feature, not an exploit. Microsoft’s own example is a recorder keeping its controls out of the capture; its Recall guidance tells developers to use the same API. OBS Studio, Zoom, Signal Desktop, KeePassXC and Bitwarden each ship or document a form of it.

ProductWhat it does
OBS StudioCan hide its own windows from capture apps, OBS included, with WDA_EXCLUDEFROMCAPTURE. Needs Windows 10 version 2004 and OBS 27.2.
ZoomWindow filtering shares the screen without showing the Zoom desktop app’s own windows. Zoom documents this for its own windows only.
Signal DesktopScreen security, on by default on Windows 11 since May 2025. Signal warns it can interfere with screen readers and magnifiers.
KeePassXC 2.7.0Uses WDA_EXCLUDEFROMCAPTURE on Windows and NSWindowSharingNone on macOS.
Bitwarden desktopDocuments its Allow screen capture setting with a hedge: the app stays out of most screenshots and screen shares.

Bitwarden’s hedge is the right model; it is why Kopya says supported screen shares and recordings. Typical uses match Microsoft’s example: presenting and demos and recording tutorials.

Common questions

How do I check that a window is really excluded?

Test the output, not the flag: reading it back with GetWindowDisplayAffinity only proves it was set. Start the exact tool and share mode you plan to use, record ten seconds or join from a second device, and look. Kopya has not published per-tool results yet; the compatibility page lists what each vendor documents and the 60-second self-test.

Can an app hide another app’s window from screen capture?

Not with these APIs. Microsoft documents that the window must belong to the calling process, and NSWindow.sharingType is set by an app on its own windows. For other apps, use a native method from five ways to hide a window from a screen share or the Zoom, Meet and Teams guide.

Does capture exclusion also apply to screenshots?

On Windows a screenshot is a capture, so the documented behaviour applies; Signal says its protected window does not appear in Windows 11 screenshots. On macOS it varies: in a December 2024 Apple forum thread, a developer reported a window missing from screenshots but present in screen recordings.

Does WDA_EXCLUDEFROMCAPTURE keep a window out of Windows Recall?

Microsoft’s Recall guidance tells app developers to use SetWindowDisplayAffinity to keep a window’s content out of Recall snapshots; its example sets WDA_MONITOR. Signal made screen security the default on Windows 11 for that reason. Kopya has not published its own Recall test.

Sources

  1. Microsoft Learn — SetWindowDisplayAffinity
  2. Microsoft Learn — GetWindowDisplayAffinity
  3. Microsoft Learn — Recall guidance for developers
  4. Microsoft Learn — Azure Virtual Desktop capture protection
  5. Apple Developer — NSWindow.SharingType.none
  6. Apple Forums — window sharing state (July 2024)
  7. Apple Forums — screenshots versus recording (December 2024)
  8. Apple Forums — no public capture-prevention APIs (July 2025)
  9. Apple Forums — inconsistent ScreenCaptureKit behaviour (November 2025)
  10. Electron docs — BrowserWindow setContentProtection
  11. Electron issue #48258 — macOS ScreenCaptureKit
  12. Electron PR #48290 — docs caveat
  13. OBS Studio PR #5698 — hide windows from capture
  14. Zoom Support — window filtering
  15. Signal blog — screen security
  16. KeePassXC PR #6030 — capture protection
  17. Bitwarden Help — app settings

Try Kopya on your own screen

Free to start, no card required. Screen-share privacy is on by default on every plan — test it with your own tools before you rely on it.

Download for macOS

Free to start · no card required ·

Do not use Kopya in exams, interviews, assessments or other settings that prohibit outside assistance. Read the acceptable-use terms