如何区分自动获取剪贴板数据和真实内容粘贴?

发布于 2024-10-17 18:35:24 字数 152 浏览 9 评论 0原文

我正在尝试开发一个简单的工具,当用户将内容粘贴到未经授权的应用程序时通知用户。我已经连接了 getclipboarddata 函数来执行此操作。但是像 MS Office 这样的应用程序有时会启动 getclipboarddata 来检索内容,但这不是用户粘贴操作。如何区分这些不同的调用?

i'm trying to dev a simple tool which notify the user when he is pasting content into an unthorized application. I ve hooked the getclipboarddata function to do this. But application like MS office launch sometimes getclipboarddata to get retrieve the content but it s not a user pasting action. How to differentiate those different calls ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不回头走下去 2024-10-24 18:35:24

任何剪贴板查看器都会自动将数据粘贴到自身中。这包括剪贴板程序,例如我自己的 ClipMate,以及 Office、具有剪贴板历史记录的各种编辑器、远程桌面、VMWare 和老大哥/恶意软件应用程序。
假设您正在谈论纯文本,则无法确定用户启动的粘贴。您可以通过查看是否按下了 Ctrl+V 或 Shift+Insert 来猜测。但这是相当不稳定的。

Any clipboard viewer is going to auto-paste data into itself. This includes clipboard programs like my own ClipMate, as well as Office, various editors with clipboard history, remote desktop, VMWare, and big-brother/malware apps.
Assuming that you're talking about plain text, there is no way to determine a user-initiated paste. You can guess, by looking to see if Ctrl+V or Shift+Insert is pressed. But that's pretty shaky.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文