想了解 Windows 剪贴板内部原理

发布于 2024-12-16 13:50:23 字数 338 浏览 4 评论 0原文

我有兴趣学习 Windows 系统内部结构及其工作原理。我倾向于学习windows上的系统编程。在这种情况下,我很想知道有关 Windows 剪贴板内部功能的一些事情:

  • 当我们选择一些文本、图像等并按下时,到底会发生什么 Ctrl + C ?
  • 当我们在不同的应用程序中按 Ctrl + V 时,到底会发生什么?
  • 复制的数据到底驻留在哪里?复制的数据是否进入内核模式内存 - 在所有进程之间共享?
  • 复制的数据如何可供不同的进程使用?

我想从系统程序员的角度知道上述问题的答案。

另外,共享讨论 Windows 剪贴板内部结构的任何资源。

I am interested in learning windows system internals and how things work. I am inclined towards learning system programming on windows. With that context, I am curious to know few things on how windows clipboard internally functions:

  • What precisely happens when we select some text, image etc and press
    Ctrl + C ?
  • What precisely happens when we we press Ctrl + V in different application?
  • Where exactly the copied data resides? Does the copied data go into kernel mode memory - that is shared across all processes?
  • How the copied data becomes available to a different process?

I want to know the answer to the above questions from the system programmer's perspective.

Also, share any resources that discuss about windows clipboard internals.

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

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

发布评论

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

评论(1

心碎的声音 2024-12-23 13:50:23

我的网站上有一些很好的资源:http://www.clipboardextender.com
它讨论了剪贴板查看器的实现、典型错误、该做和不该做的事情。

基本上,剪贴板是一个共享内存区域,您可以将数据复制到其中(也称为“复制”,例如响应用户按 Ctrl+C)并从中复制数据(也称为“粘贴”)。
数据可以同时以数十种常见格式和任意数量的程序员定义的格式表示。

不可能完全“备份”剪贴板并按原样恢复它,而不影响其他程序,并造成负面的用户体验。查看“延迟渲染”以了解原因,并考虑当 Excel 用户在电子表格中复制 5000 行 x 255 列并按 Ctrl+V 时会发生什么。了解这一点,您就会了解延迟渲染的魔力(和陷阱)。

I have some good resources on my site: http://www.clipboardextender.com
It talks about clipboard viewer implementation, typical mistakes, do's and dont's.

Basically the clipboard is a shared memory area that you copy data into (aka. "copy", such as in response to the user pressing Ctrl+C) and copy data from (aka "paste").
The data can be simultaneously represented in dozens of common formats, and any number of programmer-defined formats.

It is impossible to completely "backup" the clipboard and restore it like it was, without impacting other programs, and causing a negative user experience. Look into "delayed rendering" to see why, and consider what would happen when an Excel user copies 5000 rows x 255 columns in a spreadsheet, and presses Ctrl+V. Understand that, and you'll understand the magic (and pitfalls) of delayed rendering.

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