检测用户何时截取我的程序 [英] Detect when users take screenshots of my program

查看:54
本文介绍了检测用户何时截取我的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个 Windows 应用程序.我如何知道何时截取了屏幕截图?我阅读了有关如何检测被按下的热键的信息,但我更担心每隔 100 毫秒左右另一个程序对其进行截图的情况.也就是说,我试图注意到有人创建了另一个程序(比如使用 ImageGrab 的 Python 程序,如另一篇文章所述),该程序不断截取我的应用程序的屏幕截图并使用它们从中读取信息.

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 the case where every 100 ms or so another program is taking screenshots of it. Namely, I'm trying to notice when someone creates another program (say a python one using ImageGrab, as mentioned in another post) which constantly takes screenshots of my app and uses them to read info off of it.

我不太关心如何防止截取屏幕截图 - 一旦发现这种行为,我就可以禁止用户.

I don't care much about preventing the screenshots from being taken - I can just ban the user once this behavior is noticed.

这可能吗?当任何应用程序截取屏幕截图时,是否会发送 Windows 消息,例如 WM_HOTKEY?还是 Windows 只是使用来自最新绘制事件的最新信息,然后直接将其返回给其他程序,而我的应用根本无法注意到?

Is this possible? Is there a windows message sent when any app takes a screenshot, like with WM_HOTKEY? Or does windows just use the latest info from the latest paint events, and return that to the other program directly, without my app being able to notice at all?

推荐答案

无论您做什么,人们都会找到解决方法.假设存在这样一种方法,您可以可靠地检测到另一个对您的应用程序进行屏幕截图的程序.为了解决这个问题,我可以安装 VirtualBox,在 VM 中运行您的应用程序,然后让程序截取 VirtualBox(然后包含您的应用程序)的屏幕截图.您的应用程序绝对无法知道它正在拍照.

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.

这篇关于检测用户何时截取我的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆