Reputation: 11
i am working in a windows forms App(C#), which contain Windows media player to play encrypted video ,i.e due to security purpose the application should decrypt the video file and then play it using the media player
the problem now, if any one play the video and then run any screen recording application so he can easily get the video
so, the question is: how to prevent screen recording while my application is running?
Upvotes: 0
Views: 9277
Reputation: 170
I think it is possible that you can break the DLL the makes the screen recording when the application is working
Upvotes: 0
Reputation: 21661
The short answer is: you can't. Even if, somehow, you forced Windows to not allow any application to record the screen, a truly dedicated user could simply point a recording device at their screen (and a really dedicated user would figure out some other way around it). If you show this to your users, you'll just have to trust that they're going to play fair with it.
The other part of this is: you probably don't have to worry about it. For a screen recorder to do a reasonable job of capturing video requires a lot of processing and memory resources. The average computer will have a hard time keeping up with both decrypting, decoding, playing, and recording video all at once - and the average user will get too frustrated even if they think to try.
You could try to make it a little bit harder by looking for popular screen recording products and refusing to play the video if that process is running (or installed?). That won't be foolproof, but it would be another deterrent, e.g.
Process [] skypes = Process.GetProcessesByName("skype.exe");
Process[] otherRecorders = Process.GetProcessesByName("recorder.exe");
if (skypes.Length > 0 || otherRecorders.Length > 0) // don't play
Of course, this is still complicated by the possibility of those processes running under different credentials that your app can't access (require your app to run as admin?), and some processes will have weird names (the Skype Windows Store app for example).
Upvotes: 6