大
大狗熊
Unregistered / Unconfirmed
GUEST, unregistred user!
研究了好多。。。弄不好了<br><br>找到了这个源码<br><br>但是调试不好,情高手看看<br>uses SHDocVw,MSHTML;<br>procedure GetIETextField(w:longint):TStringList;<br>var i,k:integer;<br> ShellWindow: IShellWindows;<br> IE:IWebBrowser2;<br> IDoc:IHTMLDocument2;<br> spDisp:IDispatch;<br> aInputText:IHTMLInputTextElement;<br> v:OLEVariant;<br> tmpList:TStringList;<br>begin<br> tmpList:=TStringList.Create;<br> ShellWindow:=CoShellWindows.Create;<br> for k:=0 to ShellWindow.Count-1 do<br> begin<br> v:=k;<br> spDisp:=ShellWindow.Item(v);<br> spDisp.QueryInterface(IWEBBROWSER2,IE);<br> if IE=nil then continue;<br> if IE.Get_HWND<>w then continue;<br> IDoc:=IE.Document as IHTMLDocument2;<br> if iDoc=nil then continue;<br> if Idoc.Frames.Length<>0 then continue;<br> for i:=0 to Idoc.all.length-1 do<br> begin<br> if Idoc=nil then Break;<br> spDisp:=Idoc.all.item(i,varEmpty);<br> if SUCCEEDED(spDisp.QueryInterface(IHTMLInputTextElement,aInputText)) then<br> if aInputText.value<>'' then //****//<br> tmpList.add('name:'+aInputText.name+' value:'+aInputText.value);<br> end;<br> break;<br> end;<br> result:=tmpList;<br>end;