# How to Defeat Host-Based Screen-Scraping Malware at the Windows OS Layer

DevFeed: [How to Defeat Host-Based Screen-Scraping Malware at the Windows OS Layer](<https://devfeed.tech/articles/how-to-defeat-host-based-screen-scraping-malware-at-the-windows-os-layer-87874.md>)

Original publisher: [Read original article](<https://hackernoon.com/how-to-defeat-host-based-screen-scraping-malware-at-the-windows-os-layer?source=rss>)

Author: Mariano-05

Published: 2026-10-15T09:28:06Z

Content type: tutorial

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [bitlocker](<https://devfeed.tech/topics/bitlocker.md>), [win32](<https://devfeed.tech/topics/win32.md>), [engineering-culture](<https://devfeed.tech/topics/engineering-culture.md>)

Tags: [application-security](<https://devfeed.tech/tags/application-security.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [capture](<https://devfeed.tech/tags/capture.md>), [endpoint-security](<https://devfeed.tech/tags/endpoint-security.md>), [malware](<https://devfeed.tech/tags/malware.md>), [net-application-security](<https://devfeed.tech/tags/net-application-security.md>), [screen-capture-prevention](<https://devfeed.tech/tags/screen-capture-prevention.md>), [screen-scraping-malware](<https://devfeed.tech/tags/screen-scraping-malware.md>), [security](<https://devfeed.tech/tags/security.md>), [setwindowdisplayaffinity](<https://devfeed.tech/tags/setwindowdisplayaffinity.md>), [win32-api](<https://devfeed.tech/tags/win32-api.md>), [windows](<https://devfeed.tech/tags/windows.md>), [windows-forms-security](<https://devfeed.tech/tags/windows-forms-security.md>)

## AI overview

The article explains how Windows applications can use SetWindowDisplayAffinity to limit screen capture of sensitive windows. It describes the WDA_EXCLUDEFROMCAPTURE mode, a fallback to WDA_MONITOR, and limitations when a system is compromised at the kernel level.

## Source excerpt

Learn how to use SetWindowDisplayAffinity in C# to restrict standard screen capture of Windows app windows, with fallback handling and security limitations.