当前位置: 代码迷 >> ASP.NET >> web程序中怎么获取浏览器(360及ie)的窗口句柄
  详细解决方案

web程序中怎么获取浏览器(360及ie)的窗口句柄

热度:2163   发布时间:2013-02-25 00:00:00.0
web程序中如何获取浏览器(360及ie)的窗口句柄
怎么获取浏览器的窗口句柄啊!请高手指导!
IntPtr ptr = FindWindow(null, "360.exe");
IntPtr ptr = FindWindow("IEFrame", null);
IntPtr ptr = FindWindow(null, "IEFrame");

都试过了,都返回0;
参数值传什么啊?

------解决方案--------------------------------------------------------
通过FindWindow获取IE,取值
[DllImport("User32.dll")]
static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("User32.dll")]
static extern int FindWindowEx(int hwndParent, int hwndChildAfter, string lpszClass, string lpszWindow);

public static string GetURL()
{
IntPtr i= FindWindowA("IEFrame", null);
int child = FindWindowEx(parent, 0, "", null);
}

http://www.cnblogs.com/qiuyi21/articles/1302732
  相关解决方案