GhostWindow — a Windows utility that hides any window from screen capture (OBS, Zoom, Discord, etc.), removes it from the taskbar and Alt+Tab, and keeps it on top of other windows.
Works by injecting a DLL into the target process and using SetWindowDisplayAffinity (Windows 10 2004+).
- Hide a window from screen capture (OBS, Zoom, Discord, Teams, etc.)
- Remove from taskbar and Alt+Tab
- Keep on top of other windows
- Hotkeys — show/hide GhostWindow, pin/unpin target, bring to front
- Pick mode with countdown timer to select a window under the cursor
- Watchdog — automatically re-hides if the target process resets window styles
- Cursor lock — forces the default arrow cursor on hidden windows (prevents custom cursors from appearing)
- Restore windows individually or all at once on exit
- The injected DLL remains loaded until the target process exits, to avoid unloading code that may still be referenced by window hooks or callbacks.
- Windows 10 2004+ or Windows 11
- Python 3.10+
- PySide6
- Administrator rights (for injecting into elevated or other-user processes)
git clone https://github.com/yourusername/GhostWindow.git
cd GhostWindow
pip install PySide6The DLL is already built and included in the repository. To rebuild:
:: x64 Native Tools Command Prompt for VS
cl /nologo /LD /O2 /EHsc /W4 GhostWindow.cpp /Fe:GhostWindow.dll /link /DEF:GhostWindow.defg++ -O2 -shared -o GhostWindow.dll GhostWindow.cpp GhostWindow.def -luser32 -static:: Run as administrator (recommended)
python ghostwindow.py- Click "Pick a window" — a 5-second countdown appears
- Point your cursor at the target window during the countdown
- After selection, click "Hide"
- The window disappears from the taskbar, screen capture, and Alt+Tab
- Select it in the "HIDDEN WINDOWS" list and click "Show" or "Restore"
- Or click "Restore" in the bottom bar to restore all windows
| Hotkey | Action |
|---|---|
Ctrl+Shift+F3 |
Show/hide the GhostWindow window |
Ctrl+Shift+F4 |
Pin/unpin the selected window (toggle always-on-top) |
Ctrl+Shift+F5 |
Bring the selected window to front |
- During pick mode,
Ctrl+Shift+F3cancels the selection
| Button | Action |
|---|---|
| Pick a window | Select a window under the cursor |
| Hide GhostWindow | Hide GhostWindow itself |
| Hide | Hide the selected window |
| Show | Show the selected window |
| Bring to front | Activate the selected window |
| Refresh | Refresh the hidden windows list |
| Restore | Restore the selected window (un-hide) |
| Forget | Remove from the list (window stays hidden) |
| Quit | Exit, restoring all windows |
GhostWindow/
├── ghostwindow.py — entry point: app setup, hotkeys, admin check
├── constants.py — tunables, paths, hotkey labels
├── strings.py — all user-facing text
├── applog.py — rotating file logging
├── tasks.py — TaskRunner (QThreadPool, per-key de-duplication)
├── hotkey.py — global hotkey manager + native event filter
├── core/ — Win32 and domain logic (no Qt widgets)
│ ├── winapi.py — the only place with ctypes signatures and constants
│ ├── errors.py — typed errors and Win32 hints
│ ├── procs.py — Process: alive, image name, module base
│ ├── windows.py — Window: queries, stealth styling, enumeration
│ ├── injector.py — DLL injection, remote calls, detach
│ ├── stealth.py — StealthService: hide/show/pin/detach
│ ├── models.py — WindowEntry, WindowState, EntryStore
│ ├── probe.py — WindowProbe: background state snapshot
│ └── system.py — console hiding, admin check
├── ui/ — Qt widgets
│ ├── main_window.py — main view/controller
│ ├── table_model.py — QAbstractTableModel for the hidden list
│ ├── titlebar.py — frameless title bar
│ ├── picker.py — picker overlay for window selection
│ ├── cursor_lock.py — in-process cursor lock (forces arrow cursor)
│ └── style.qss — dark theme
├── GhostWindow.cpp — DLL source
├── GhostWindow.def — DLL exports
└── GhostWindow.dll — built DLL
The core package contains no Qt GUI code, so the WinAPI/domain logic can be
tested or reused without starting an event loop. MainWindow only handles
widgets, user intents and the entry store; blocking work runs through
TaskRunner on a background thread pool.
- Injection —
LoadLibraryWviaCreateRemoteThreadwith the DLL path - StealthHide — the DLL calls:
SetWindowDisplayAffinity(hwnd, WDA_EXCLUDEFROMCAPTURE)— exclude from captureWS_EX_TOOLWINDOW— remove from taskbarHWND_TOPMOST— keep on top
- StealthShow — restore the original state (styles are saved in window properties)
- Cursor Lock —
ui/cursor_lock.pyhooksWM_SETCURSORand mouse messages on the target window and all its children, forcing the default arrow cursor. A watchdog timer (~30 ms) re-applies the cursor if Qt or the target app changes it programmatically.
Runtime logs are written to ghost_debug.log next to the script (rotated at
1 MB, 3 backups). For verbose output:
set GHOSTWINDOW_DEBUG=1
python ghostwindow.pyCommon issues:
- Injection fails / access denied — restart GhostWindow as administrator. A 32-bit DLL cannot be injected into a 64-bit process, and vice versa. Windows forgotten from the list are not restored automatically. If GhostWindow crashes, restart the affected application to reset its state.
- Hotkey does not work — another application already owns it; close that
application or change the hotkey in
constants.py. - "GhostWindow.dll not found" — build the DLL or place it next to
ghostwindow.py. - Window is not hidden — UWP/Store apps and some anti-cheat protected
processes reject
SetWindowDisplayAffinityor DLL injection.
- Some anti-cheats may block DLL injection
- UWP/Store apps may not support
SetWindowDisplayAffinity - Administrator rights are required to inject into elevated processes
MIT