Add Window::SetContentProtection(bool) so the window's content is excluded from screenshots and screen recording, like Electron's win.setContentProtection():
- Windows:
SetWindowDisplayAffinity(hwnd, WDA_EXCLUDEFROMCAPTURE) (Windows 10 2004+, else WDA_MONITOR)
- macOS:
NSWindow.sharingType = NSWindowSharingNone (note: not honoured by ScreenCaptureKit on recent macOS)
- Linux: not available; document it
Background:
Add
Window::SetContentProtection(bool)so the window's content is excluded from screenshots and screen recording, like Electron'swin.setContentProtection():SetWindowDisplayAffinity(hwnd, WDA_EXCLUDEFROMCAPTURE)(Windows 10 2004+, elseWDA_MONITOR)NSWindow.sharingType = NSWindowSharingNone(note: not honoured by ScreenCaptureKit on recent macOS)Background: