2

Is there a way to protect a program from any form of screenshoting by users? For example I do not want my program to be in a screenshot when user presses Print Screen key on the keyboard. Is it possible to make somehow a key preview in the program that minimizes the program on pressing Print Screen keyt by user?

I want this for C# WinForms.

P.S. I know it is a bit stupid, user can take a real photo of the screen :P but just my curiosity!

Dumbo
  • 13,555
  • 54
  • 184
  • 288

3 Answers3

6

Only thing that I could think of right now would be using a video overlay to draw the application's contents (i.e. similar to classiv video players). That way usual screenshot programs will just get a blank/almost black image. But it's still no 100 % secure way. Everything that passes through software can be manipulated/grabbed in some way.

Mario
  • 35,726
  • 5
  • 62
  • 78
5

I can't think of any way to prevent a determined application from capturing your app's screen output. The screen can be captured by a lot more than just the PrintScreen key. In Windows, just about any app can read the entire screen device surface by reading from DC handle zero.

dthorpe
  • 35,318
  • 5
  • 75
  • 119
4

It's not possible to stop screenshots.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • 2
    Although `SetWindowDisplayAffinity` makes it more difficult. – Raymond Chen Mar 05 '12 at 20:00
  • 1
    @RaymondChen You lazy bugger - won't even link to your own blog posts. Let me sicophantically do so for you: http://blogs.msdn.com/b/oldnewthing/archive/2013/06/03/10422964.aspx – x0n Jan 05 '14 at 20:49
  • 2
    @x0n First, SO frowns upon links to offsite pages. Second, I don't have a time machine. (How could a comment from 2012 liink to a blog post from 2013?) – Raymond Chen Jan 05 '14 at 21:10
  • 1
    @RaymondChen LOL, sorry man, I did not notice the date differences. Consider me scolded. – x0n Jan 05 '14 at 21:13
  • @x0n Didn't mean it as a scolding. Just explaining. Sorry. – Raymond Chen Jan 05 '14 at 21:18
  • @RaymondChen I have been reading your blog long enough to know you don't scold; you correct with mildly sarcastic assessments. No worries man. – x0n Jan 05 '14 at 21:27