4

If the Print Scrn button is pushed and then you open paint and Ctrl V your image in there is there a way to make it so your program isn't there or maybe is substituted with a black box or something.

I don't have a lot of windows programming experience, and this is just more of a curiosity to me than something I actually plan on implementing. All feedback is appreciated.

John
  • 13,197
  • 7
  • 51
  • 101
  • Similar question here: http://stackoverflow.com/questions/3889816/how-to-disable-print-screen-button-while-running-my-application-in-wpf – John Sibly Aug 02 '11 at 16:55
  • Also this one looks useful: http://stackoverflow.com/questions/621577/clipboard-event-c – John Sibly Aug 02 '11 at 16:56

5 Answers5

2

you can't disable the Print Scrn from your winform application because it is a OS feature. even if it was possible someone could be smart enough to use a digital camera....

have also a look at the below:

http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/f8fccf61-5132-4037-809d-f22f706e9e7b

Massimiliano Peluso
  • 26,379
  • 6
  • 61
  • 70
2

The short answer is that there is no foolproof method. There is a decent discussion here about it: prevent screen capture

Community
  • 1
  • 1
jlew
  • 10,491
  • 1
  • 35
  • 58
1

Ever wonder why some videos in Windows Media player capture a black/moving screen when you attempt to screen shot them? It's called a Hardware/Video overlay.

See: en.wikipedia.org/wiki/Hardware_overlay

From the article on Wikipedia:

As a consequence of hardware overlay use, a screenshot program (for example, the one automatically built into Windows that activates when a user presses the PrtSc key) often does not capture the content appearing in the hardware overlay window. Rather, a blank region containing only the special mask color is captured. This is because the screen capture routine doesn't consider the special video memory regions dedicated to overlays - it simply captures the shared main screen as rendered by the software's graphical subsystem. Some Digital Rights Management schemes use hardware overlay to display protected content on the screen, taking advantage of this quirk to prevent the copying of protected documents by way of screen capture[citation needed]. Disabling the support for overlays causes the normal overlay-using software to fallback to the shared memory, thus enabling screenshot capture.

While I don't know how to implement this, it is certainly possible. Perhaps it would provide a good starting point for your research.

George Johnston
  • 31,652
  • 27
  • 127
  • 172
  • Yes, this would be an "annoyance level" protection that may prevent lots of people from screen-shotting the content, but won't be effective in preventing ample screen shots of it from escaping or subsequently propagating _if_ there's a reason why people would want to do that. – Chris Stratton Aug 02 '11 at 16:33
  • @Chris I would argue this is no more annoying than hooking and blocking a key combination. That almost seems more intrusive. – George Johnston Aug 02 '11 at 16:34
  • by "annoying" I mean that the entire class of ideas which assume that the computer obeys the developer rather than it's owner is generally only "annoying" to sophisticated users, rather than truly effective at achieving the developer's goals of preventing something. The business question would be if there's a public demand for the same content such that the results of a few capable individuals leaking the content would get propagated to the world at large, or if the content that each user would want to grab would be personally unique. – Chris Stratton Aug 02 '11 at 16:53
1

Yes, this is possible.

One would have to intercept the Print Screen keypress/hotkey behavior (I beleive this is a Windows hotkey) and then override with the desired behavior. Since the data is being stored in memory and is accessable by the clipboard, one could clear the data or not enable the data to be stored in the first place.

If this is Windows, one will have to use the Windows API to accomplish this.

I believe there are several commercial programs that have this type of feature to protect any documents or any copying of data from the computer.

MSDN describes the print screen hot key here:

http://msdn.microsoft.com/en-us/library/ms646279(v=vs.85).aspx

Jon Raynor
  • 3,804
  • 6
  • 29
  • 43
0

There's definitely a way to do it--it's just a question of how low in the stack you need to go to get it done and how much work it's going to take.

If rootkits can hide all traces of a userspace process, then they can certainly be written to intercept printscreens and hide a window for that split second while the capture is taking place.

pepsi
  • 6,785
  • 6
  • 42
  • 74