Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent (disable) video capturing of my WPF application

Is there a way to prevent or disable video capturing of my WPF application? Probably some Win32 API calls or some mask over my WPF content. Or if it is imposible is there a way to at least prevent the most popular screen capture programs from recording what is happening in my WPF application?

like image 703
Nikolay Kostov Avatar asked Sep 11 '25 02:09

Nikolay Kostov


1 Answers

To prevent an application from capturing window contents, you can call the SetWindowDisplayAffinity Windows API with a WDA_MONITOR affinity. While this prevents applications from capturing a screen, it will not prevent a user from whipping out their smart phone and taking a picture of the screen.

The API is available on systems running Windows 7 and later. It's also required that Desktop Window Manager composition is enabled. Turning off DWM composition will undo the effect, so you need to prevent users from turning DWM composition off. If you are running Windows 8 and later, this is not an issue, since Desktop Window Manager is always on.

like image 63
IInspectable Avatar answered Sep 13 '25 06:09

IInspectable