Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to detect a screen capture or recording?

I'm making a Winforms program for a friend, and one of the functions he wants implemented is to hide the contents of a textbox from being recorded; meaning he wants it safe from screenshots and screen recordings.

At this point I tried explaining the futility of this, explaining that

  1. There are LOADS of programs that can be used to record/capture the screen, and trying to watch for all of them would not only be too exhaustive to explain, it would also be pointless, since any programmer worth his salt can put together a personal program that can take a screenshot without using any of the known names
  2. Even IF you somehow manage to block every program, a person can just take a picture of the screen

To answer the issue of taking a picture of the screen, he said that while we can't make the program perfect, we CAN make it as hard as possible for someone to "hack" it. (Personal opinion is that he's sort of right, but I don't think we should go overboard for something with such a simple work-around)

His answer to the issue of there being tons of different recording program however was sort of interesting, but I don't know enough to give him answer with confidence. He theorized that there HAD to be some common action in all of the programs, since to some degree, they all grab a copy of the data that is displayed on the screen to use, and that we should be able to theoretically be able to detect that action and react accordingly.

So my question is this: Does anyone know if there is a common action for programs that record the screen, and if there is a common action, what it is?

like image 662
Daniel Avatar asked Feb 02 '16 21:02

Daniel


2 Answers

All the screen capture programs work the same in that the interact with the graphics engine to capture the image of the screen at a point in time but that is as far as it goes, there is no event trigger when a screen capture is done and so no way to detect when a capture occurs.

Edit: The way a screen capture program gets access to the screen is by calling GetDC(NULL). It then copies the contents into a bitmap using the BitBit function. There is no event triggered when calling GetDC(), there may be a method built into Windows which has not been documented by Microsoft and is hidden deep within the Windows API but nothing which has been documented at this time.

For more information on this, take a look at Windows Confidential: What You See Is What You get

like image 153
Chris Rutherfurd Avatar answered Oct 13 '22 00:10

Chris Rutherfurd


In case of screen capture, if we monitor the clipboard and detect the foreground application running, we can recognize the activity. In case of snipping tool, if capture a screen shot it goes to clipboard and we can paste it directly.

like image 28
Shiv Avatar answered Oct 12 '22 22:10

Shiv