为什么在资源管理器窗口关闭后会启动多个 GetClipboardData?

发布于 2024-10-18 04:31:35 字数 195 浏览 7 评论 0原文

我正在开发一个小软件,以便在用户将内容粘贴到未经授权的应用程序中时通知用户,我挂钩 GetClipboardData 来执行此操作。几乎一切都工作正常,但是当我从 Word 复制内容时,例如,我单击 InternetExplorer,打开一个资源管理器窗口并关闭它,一些 GetClipboardData 是从资源管理器启动的。有人可以帮助我理解这种行为吗? 提前致谢 问候

I m developping a little soft to notify users when they are pasting content in unauthorized applications, i hook the GetClipboardData to do so. Nearly everything is working fine but when i copy content from Word for example, i click on InternetExplorer, i open an explorer window and close it, some GetClipboardData are launched from explorer. Can someone help me to understand that behavior ?
Thanks in advance
Regards

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

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

发布评论

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

评论(1

感性 2024-10-25 04:31:38

当您执行诸如关闭窗口之类的操作或执行任何使应用程序停止并思考的操作时,从某些应用程序(主要是 Microsoft)接收意外的剪贴板事件是很常见的:“嘿,也许我在剪贴板上留下了一些垃圾,我最好清理它,也许将其重新发布为没有 OLE 内容的纯文本,也许我已经这样做了,但我不记得了,所以我会再做一次。”这是一种强迫症,他们几乎把一切都融入其中。有时,当您退出程序时,您会看到一个弹出窗口,提示“您已在剪贴板上放置了大量数据,是否希望将其可供其他应用程序使用”。这是同样的事情。基本上,他们在剪贴板上放置了一堆需要“延迟渲染”才能粘贴的格式。现在,该应用程序担心在剪贴板上留下无效数据,因此它必须重新发布没有奇特格式的数据。
如果您从 Excel 复制单元格,然后取消突出显示该单元格,您也会得到此信息。
如果您在启动应用程序时收到剪贴板事件,则它可能是一个附加程序挂接到剪贴板链中,或者可能犯了最严重的错误:将其图标复制/粘贴到工具栏中。

It is common to receive unexpected clipboard events from certain applications, mostly from Microsoft, when you do things like closing windows or doing anything that makes the application stop and think: "hey, maybe I left some crap on the clipboard, I'd better clean it up, maybe re-post it as plain text without the OLE stuff, maybe I already did that, but I can't remember, so I'll do it again." It's a sort of OCD that they build into just about everthing. Sometimes you get a pop-up saying "you've placed a large amount of data on the clipboard, would you like to make it available for other applications" when you quit a program. That's the same thing. Basically, they've put a bunch of formats on the clipboard that would require "delayed rendering" to be pasteable. And now the app is worried about leaving invalid data on the clipboard, so it has to re-post the data without the fancy formats.
You'll also get this if you copy a cell from Excel, and then un-highlight that cell.
If you get a clipboard event when STARTING an app, it's likely an add-in hooking into the clipboard chain, or perhaps committing the worst sin of all: copy/pasting its icon into a toolbar.

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