如何显示打开IE浏览器选项卡作为DWM缩略图? [英] How do I display open IE tabs as DWM thumbnails?
问题描述
我建立在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.
我已经找到了如何枚举使用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屋!