Ultimate screenshot freedom for Telegram Desktop on Windows.
A focused, dependency-free freedom-oriented Python utility that temporarily disables Telegram
Desktop's capture-affinity call, allowing Snipping Tool, Win + Shift + S,
screen sharing, and compatible capture software to see the Telegram window.
Telegram Desktop 7.1.x introduced screenshot protection on Windows. In affected setups, invoking Windows Snipping Tool can make the entire Telegram window disappear from the capture surface.
TelegramScreenshot fixes the problem:
- ⚡ patches an already-running Telegram process in seconds;
- 📸 restores
Win + Shift + Sand Snipping Tool capture; - 🔄 can run invisibly at Windows sign-in and reapply after Telegram restarts;
- 🧼 makes no changes to
Telegram.exe,tdata, chats, or account settings; - 📦 uses only the Python standard library;
Start Telegram, then double-click:
run-once.bat
Approve the Windows elevation prompt. The patch remains active until Telegram exits.
Double-click:
add-startup-persistent.bat
The installer creates a per-user Windows startup entry and immediately launches
the watcher through pythonw.exe. No console window remains visible.
TelegramScreenshot will start every time you sign in and patch each new
Telegram.exe process.
To stop the watcher and remove its startup entry completely, double-click:
remove-startup-persistent.bat
| Requirement | Details |
|---|---|
| Operating system | Windows 10 or Windows 11 |
| Python | 64-bit Python 3.10 or newer |
| Telegram | 64-bit Telegram Desktop with the affected capture-affinity implementation |
| Privileges | One-shot mode requests Administrator access; startup mode runs as the signed-in user |
| Packages | None |
TelegramScreenshot currently targets 64-bit processes.
TelegramScreenshot is version-independent within a specific implementation boundary:
It supports 64-bit Telegram Desktop builds on x64 Windows when
Telegram.exeimportsSetWindowDisplayAffinitythrough a normal or delay-loaded import table.
The utility discovers process IDs, ASLR module bases, Telegram window handles, the import table, and the target IAT entry dynamically. It contains no Telegram-version-specific address, installation path, PID, window handle, instruction signature, or IAT offset.
The implementation does contain stable Windows x64 details: PE32+ structure offsets, the Windows x64 calling convention, a six-byte x64 return stub, and the x64 PEB location used to obtain the image base. These are platform and architecture assumptions—not offsets taken from a particular Telegram build.
A future Telegram release may require an update if it moves the call into a different module or process, resolves it dynamically, changes the process name, or stops importing the API. ARM64 and 32-bit builds are not currently supported.
| Mode | Launcher | Python command | Behavior |
|---|---|---|---|
| One shot | run-once.bat |
python main.py |
Patches every running Telegram process, then exits |
| Install at startup | add-startup-persistent.bat |
pythonw main.py --watch |
Runs invisibly at sign-in and patches new Telegram processes |
| Remove from startup | remove-startup-persistent.bat |
— | Stops the verified watcher and removes its generated state |
| Custom polling | — | python main.py --watch --interval 5 |
Uses a custom interval in seconds |
Command-line help is available with:
python .\main.py --helpTelegram's Windows implementation calls the documented Win32
SetWindowDisplayAffinity
API with WDA_EXCLUDEFROMCAPTURE. Windows then omits the protected top-level
window from supported capture paths.
TelegramScreenshot performs four narrowly scoped actions:
- Finds processes whose executable name is exactly
Telegram.exe. - Locates Telegram's normal or delay-loaded import-table entry for
SetWindowDisplayAffinity. - Calls the original function inside Telegram with
WDA_NONEto clear the affinity of existing Telegram windows. - Redirects that one import entry to a six-byte function that returns success without reapplying protection.
The replacement lives only in Telegram's private process memory. No Windows system DLL and no executable on disk is patched.
While patched, Telegram's screenshot protection is disabled for every chat in that Telegram process, including restricted or non-copyable chats. Use the tool only on systems and accounts you are authorized to operate.
Because the technique writes to another process's memory and creates a short remote thread, endpoint security software may flag or block it. Review the source before running it and follow your organization's security policy.
Start Telegram Desktop and run run-once.bat again, or use
add-startup-persistent.bat before starting Telegram.
Use one of the batch launchers and accept its elevation prompt. If Telegram is running under a different Windows account or security boundary, access may still be denied.
Install a 64-bit Python build and ensure python.exe or the py launcher is on
PATH.
Process-memory patching resembles techniques used by debugging and security tools, so detection is possible. Do not disable organizational security controls without authorization. Restarting Telegram safely restores its normal state if the patch was only partially applied.
The installer now treats registry or process-launch errors as fatal and reports
the real Windows error instead of displaying a false success message. A
Requested registry access is not allowed message can also come from running
inside a restricted sandbox; it is not, by itself, a Defender malware
detection.
TelegramScreenshot deliberately validates the PE import structure instead of using fixed offsets. A future Telegram build may nevertheless change how the API is resolved. Check the source before adapting the tool to a new build.
Older Telegram versions that never implemented this display-affinity path may also report that the import cannot be found; those versions ordinarily do not need this workaround.
TelegramScreenshot/
├── .gitignore # Ignores generated runtime state
├── LICENSE # MIT license
├── main.py # Core utility and command-line module
├── run-once.bat # Elevated one-shot launcher
├── add-startup-persistent.bat
│ # Install and start the invisible watcher
├── remove-startup-persistent.bat
│ # Stop and fully remove startup mode
└── README.md # Project documentation
This project is a temporary interoperability workaround, not a security bypass guarantee. Use it only with software, systems, conversations, and content you are authorized to capture. You are responsible for complying with workplace policies, privacy obligations, applicable law, and Telegram's terms.
TelegramScreenshot is released under the MIT License.
Copyright © 2026 kolya5544.