如何显示打开IE浏览器选项卡作为DWM缩略图? [英] How do I display open IE tabs as DWM thumbnails?

查看:612
本文介绍了如何显示打开IE浏览器选项卡作为DWM缩略图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立在C#WPF应用程序,我想在一个列表框来显示打开的IE选项卡的缩略图。我基本上是试图复制在Windows 7 DWM功能。

I am building a WPF application in C# and I want to display thumbnails of open IE tabs in a listbox. I'm essentially trying to duplicate the DWM functionality in Windows 7.

Windows

我已经找到了如何枚举使用Interop.ShDocVW打开的选项卡的列表,但为了使用DWM API调用,我有一个 HWND 和标签传递都有着相同的句柄作为IE浏览器。

I have figured out how to enumerate a list of open tabs using Interop.ShDocVW, but in order to use the DWM API calls, I have to pass in an hwnd, and the tabs all share the same handle as Internet Explorer.

所以我一直搞乱 EnumWindows的 EnumChildWindows 但我不能得到任何工作。

So I've been messing with EnumWindows and EnumChildWindows but I can't get anything to work.

如何以最佳方式处理这个?

Any suggestions on how to best approach this?

推荐答案

在我去解决任何建议使用 EnumWindows的 GetWindowText时从Win32 API的。我通过Internet Explorer窗口枚举使用 shdocvw.dll中和标签的标题传递给解析 GetWindowText时的结果的方法找到与标题窗口的HWND。

The solution I went with was using EnumWindows and GetWindowText from the Win32 API. I enumerate through Internet Explorer windows using shdocvw.dll and pass the tab's caption to a method that parses the results of GetWindowText to find the hwnd of the window with that caption.

这适用于所有的IE窗口,而不仅仅是标签。

This works for all IE windows, not just tabs.

这篇关于如何显示打开IE浏览器选项卡作为DWM缩略图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆