你怎么读就怎么清啊,赋值为空
public mshtml.IHTMLDocument2 GetHtmlDocument(int hwnd) { System.Object domObject = new System.Object(); int tempInt = 0; System.Guid guidIEDocument2 = new Guid(); int WM_Html_GETOBJECT =Win32API.RegisterWindowMessage("WM_Html_GETOBJECT");//定义一个新的窗口消息 int W = Win32API.SendMessage(hwnd, WM_Html_GETOBJECT, 0, ref tempInt);//注:第二个参数是RegisterWindowMessage函数的返回值 int lreturn = Win32API.ObjectFromLresult(W, ref guidIEDocument2, 0, ref domObject); mshtml.IHTMLDocument2 doc = (mshtml.IHTMLDocument2)domObject; return doc; }
我是这样读的,返回的是一个对象
@MarcoFly:
为什么要样拿,不是同一个进程?
@Rich.T: 是啊 ,不在同一个进程的,有什么方法可以实现吗
mshtml.IHTMLDocument2 document = GetHtmlDocument(hwnd);
document.body.innerHTML = null;//清屏