WindowCaptureHider is a lightweight Windows DLL that hides top-level application windows from screen-capturing tools such as OBS, Snipping Tool, Microsoft Teams, Zoom, and others.
It uses the Windows API SetWindowDisplayAffinity to block these windows from being captured or recorded.
⚠️ Note: This repository serves as personal GitHub storage for development backup and archival purposes. While it is public and functional, it is not maintained as a full-scale production library. Users are welcome to fork or reuse the code as needed.
- Key Features
- How It Works
- Quick Start
- Building From Source
- Public API
- Security & Limitations
- Contributing
- Roadmap
- License
| Feature | Description |
|---|---|
| Universal capture-blocking | Automatically hides all top-level windows using WDA_EXCLUDEFROMCAPTURE. |
| Self-healing window loop | Re-enumerates windows every second to apply or remove capture-blocking. |
| Minimal footprint | No dependencies beyond Win32 API. ~150 lines of C++ code. |
| Auto start & stop | Starts on DLL load (DLL_PROCESS_ATTACH) and stops on unload. |
| Inject or load manually | Can be injected into any running process or loaded dynamically. |
| Multi-platform builds | Works on both x86 and x64. MSVC, Clang, and MinGW supported. |
| Personal GitHub Storage | Maintained as a personal development backup; not a user-configurable tool. |
EnumWindowsgathers all top-level window handles.- Each window is set to
WDA_EXCLUDEFROMCAPTUREusingSetWindowDisplayAffinity. - Valid handles are stored in a set to track which ones are hidden.
- Every second, a background thread updates the set: hiding new windows and removing destroyed ones.
- Cleanup is performed when the DLL is unloaded or
StopHidingWindows()is called.
Download the latest version of WindowCaptureHider.dll from the Releases page.
injector.exe --pid <target-process-id> --dll WindowCaptureHider.dllHMODULE hLib = LoadLibrary("WindowCaptureHider.dll");
// Starts automatically on load- Visual Studio or MSVC Build Tools
- CMake (optional, for project generation)
git clone https://github.com/myexistences/WindowCaptureHider.git
cd WindowCaptureHider
cl /LD WindowCaptureHider.cpp /Fe:WindowCaptureHider.dllOr open WindowCaptureHider.sln in Visual Studio and build in Release/x64.
These two functions are exported by the DLL for manual control:
extern "C" __declspec(dllexport) void StartHidingWindows();
extern "C" __declspec(dllexport) void StopHidingWindows();You can call them manually after loading the DLL to start or stop the hiding loop.
- Windows may override
WDA_EXCLUDEFROMCAPTUREin some environments (e.g. admin restrictions). - This technique only hides windows from software-based screen capture, not from physical monitors or print screens.
SetWindowDisplayAffinityonly works on Windows 8 and above.
This project is primarily for personal use, but improvements or suggestions are welcome via pull requests or issues.
- Add window filtering by title/class (optional)
- GUI interface for selecting specific windows
- Log hidden windows in debug mode
This project is licensed under the GNU Affero General Public License v3.0 .