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
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?
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With