有没有办法确定某些 Windows 应用程序是否正在捕获屏幕
Is there a way to figure out whether some Windows application is capturing screen
目前我有 C# 应用程序,它利用 SetWindowDisplayAffinity,它应该通过将选定的 windows 涂黑来防止捕获。但是,根据 this post 看来,Windows 的某些早期版本在该机制中存在错误。
那么,是否可以通过 pinvoke 或其他方式检测到当前正在捕获屏幕,以便在不调用系统 API 的情况下手动关闭我的 windows?
没有 API 可以让您确定进程是否正在捕获(部分)屏幕。
捕获屏幕只是一系列常规 API 调用,系统不会跟踪哪些进程以允许它们捕获屏幕内容的方式使用它们。事实上,它不能。捕获屏幕内容不是状态,而是事件。
您使用的功能不是安全功能。如 documentation 中所述:
It is important to note that unlike a security feature or an implementation of Digital Rights Management (DRM), there is no guarantee that using SetWindowDisplayAffinity [...] will strictly protect windowed content, for example where someone takes a photograph of the screen.
目前我有 C# 应用程序,它利用 SetWindowDisplayAffinity,它应该通过将选定的 windows 涂黑来防止捕获。但是,根据 this post 看来,Windows 的某些早期版本在该机制中存在错误。
那么,是否可以通过 pinvoke 或其他方式检测到当前正在捕获屏幕,以便在不调用系统 API 的情况下手动关闭我的 windows?
没有 API 可以让您确定进程是否正在捕获(部分)屏幕。
捕获屏幕只是一系列常规 API 调用,系统不会跟踪哪些进程以允许它们捕获屏幕内容的方式使用它们。事实上,它不能。捕获屏幕内容不是状态,而是事件。
您使用的功能不是安全功能。如 documentation 中所述:
It is important to note that unlike a security feature or an implementation of Digital Rights Management (DRM), there is no guarantee that using SetWindowDisplayAffinity [...] will strictly protect windowed content, for example where someone takes a photograph of the screen.