如何区分自动获取剪贴板数据和真实内容粘贴?
我正在尝试开发一个简单的工具,当用户将内容粘贴到未经授权的应用程序时通知用户。我已经连接了 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
任何剪贴板查看器都会自动将数据粘贴到自身中。这包括剪贴板程序,例如我自己的 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.