怎么获取浏览器的窗口句柄啊!请高手指导!
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