是否可以捕获包含 Windows 7 DWM 缩略图的窗口?

发布于 2024-08-20 21:56:02 字数 230 浏览 2 评论 0原文

我开始相信你不能用 Windows API 做任何事。

我有两个窗户。其中有一个 DWM 缩略图。我想要做的是,我希望能够将窗口屏幕的缩略图捕获到另一个窗口中。 当我使用 bitblt 执行此操作时,除了缩略图之外的所有内容都会被复制。它只是位图中不存在。

那么DWM渲染是如何工作的呢?我的意思是,如果 DWM 将缩略图直接渲染到注册窗口的 DC 上,那么我的方法应该有效。我很困惑。

非常感谢。

I am starting to believe that you can do nothing with Windows API.

I have two windows. One has a DWM thumbnail in it. What I want to do is, I want to be able to capture the screen of the window with the thumbnail into the other one.
When I do this, using bitblt, everything is copied except the thumbnail. It just isn't there in the bitmap.

So how does the DWM rendering work? I mean, if DWM renders thumbnails directly onto the DC of the registered window, then my approach should work. I'm confused.

Thanks a bunch.

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

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

发布评论

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

评论(2

吻安 2024-08-27 21:56:03

这不是 DWM 的工作原理:缩略图的内容永远不会传输到窗口的 DC 上。相反,当桌面显示时,DWM 合成引擎将直接在窗口内容上呈现缩略图。

不幸的是,没有(官方)方法来访问 DWM 缩略图的图像数据(但是有一个 hack< /a> 尝试访问底层顶点数据并在 DirectX 9 中渲染它。

That's not how DWM works: the contents of the thumbnail are never blitted onto the DC of your window. Instead, the DWM composition engine will render the thumbnail directly over the contents of your window when the desktop is presented.

There's no (official) way to access the image data of a DWM thumbnail unfortunately (there is however a hack on the net that tries to access the underlying vertex data and render it in DirectX 9).

昔梦 2024-08-27 21:56:03

您不能期望将缩略图放置在窗口的设备上下文中,因为缩略图没有放置在窗口的设备上下文中。所以你的方法不会起作用。

但如果您想窃取应用程序的缩略图,只需询问 Dwm 为您提供缩略图。这将允许您向用户呈现您想要的确切缩略图。

另一方面,如果您想访问另一个进程的缩略图中的像素,那么您就会遇到问题。

You cannot expect a thumbnail to be place in a window's device context, because the thumbnail is not placed in a window's device context. So your approach will not work.

But if you're trying to steal the thumbnail of an application, just ask the Dwm to give you it's thumbnail. That will allow you to present to the user the exact thumbnail you want.

If, on the other hand, you want to access the pixels in the thumbnail of another process, then you have a problem.

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