日期:2014-05-18  浏览次数:20986 次

C#如何遍历IE窗体
当前打开了若干IE窗口(有些最小化了),如何遍历(取得句柄)?

------解决方案--------------------
不知道要做什么.. 帮顶下!
------解决方案--------------------
MSDN "ShellBrowser"
------解决方案--------------------
引用System32中SHDocVw.dll和Shell32.dll
C# code
private void Form1_Load(object sender, EventArgs e)
        {
            Shell32.ShellClass shell = new Shell32.ShellClass();
            SHDocVw.ShellWindows windows = shell.Windows() as SHDocVw.ShellWindows;
            string[] lines = new string[windows.Count];
            for (int i = 0; i < windows.Count; i++)
            {
                SHDocVw.ShellBrowserWindow win =  windows.Item(i) as SHDocVw.ShellBrowserWindow;
                lines[i] = win.LocationName;
            }
            memoEdit1.Lines = lines;
        }

------解决方案--------------------
5L可以
------解决方案--------------------
用BHO