Detect when users take screenshots of my program

前端 未结 10 1454
猫巷女王i
猫巷女王i 2020-12-09 13:38

I\'m writing a Windows application. How can I tell when a screenshot is being taken of it? I read about how to detect the hotkey being pressed, but I\'m more worried about t

相关标签:
10条回答
  • 2020-12-09 14:00

    Another reason why I think it will be impossible to achieve this:

    A long time ago, I failed to make a screen capture of the content of Windows Media Player, because (I assumed) WMP streamed that content to the videocard right away. (Fun detail: after pasting the screen capture, the video would continue playing in MS Paint, but saving the image would eventually yield a black square). Anyway, using VNC made it very easy to get the screen capture after all.

    0 讨论(0)
  • 2020-12-09 14:00

    I assume you really can't because one can always run your program in a window with virtual machine, then using a capture program on the outside platform, and knowing if this is happaning is mighty difficult. I suggest thinking more in ways of special rendering pace or interlacing, special contrasts, etc...

    You can also run your outputs to the screen as if it was a movie, encode it with a low rate and resolution encoder, so that a still capture every 100ms will be in such a low quality that it would be worthless. (have you ever freezed a low quality movie?)

    however you really should consider using other ways to protect your info.

    0 讨论(0)
  • 2020-12-09 14:03

    This is never going to work. Not only that, but attempts to provide this level of security are going to inconvenience 99% of your legitimate users.

    You perhaps are best to approach the problem from the angle of trying to identify unwanted uses/copies of your information and approach the people/companies using that information.

    Copyright law is appropriate for this approach, but I understand that there are some intances where this approach is not available.

    0 讨论(0)
  • 2020-12-09 14:03

    You can (unreliably) do this by using SetWindowsHookEx.

    Here is a complete VB.NET example.

    However, there are many ways around this. A hook installed after yours will "override" your hook. Users can take pictures of their screen in many ways, as described in this thread. I'd try to consider other options for protection than this.

    0 讨论(0)
  • 2020-12-09 14:03

    It's pretty hard to stop it completely... A user who is determined enough could just take a photo of the screen with a digital camera.

    0 讨论(0)
  • 2020-12-09 14:05

    Whatever you do, people will find a way around it. Suppose such a method existed, where you could reliably detect another program taking a screenshot of your application. To get around that, I could install VirtualBox, run your application inside the VM, and then have a program take screenshots of VirtualBox (which then contains your application). Your application would have absolutely no way to know it was having its picture taken.

    0 讨论(0)
提交回复
热议问题