得到IE地址栏的地址(100分)

  • 主题发起人 主题发起人 cool_cool
  • 开始时间 开始时间
C

cool_cool

Unregistered / Unconfirmed
GUEST, unregistred user!
怎么得到地址栏中的网址??
 
除了注册表呢
 
用下面的方法可以从所有打开的IE窗口中得到URL地址<br>var<br>ShellWindow: IShellWindows;<br>&nbsp; nCount: integer;<br>&nbsp; spDisp: IDispatch;<br>&nbsp; i: integer;<br>&nbsp; vi: OleVariant;<br>&nbsp; IE1: IWebBrowser2; &nbsp; //IE这里是源代码:<br><br>begin<br>&nbsp; ShellWindow := CoShellWindows.Create;<br>&nbsp; nCount := ShellWindow.Count;<br>&nbsp; for i := 0 to nCount - 1 do<br>&nbsp; begin<br>&nbsp; &nbsp; vi := i;<br>&nbsp; &nbsp; try<br>&nbsp; &nbsp; spDisp := ShellWindow.Item(vi);<br>&nbsp; &nbsp; except exit end;<br>&nbsp; &nbsp; if (spDisp&lt;&gt;nil) then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; try<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; spDisp.QueryInterface( iWebBrowser2, IE1 );<br>&nbsp; &nbsp; end<br>&nbsp; &nbsp; except<br>&nbsp; &nbsp; on EAccessViolation do begin exit end;<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; if (IE1 &lt;&gt; nil) then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; Log.Lines.add( 'LocationUrl: ' + IE1.Get_LocationURL());<br>&nbsp; &nbsp; end;<br>end;<br>end;<br>
 
to samhunt<br>&nbsp;那两个接口在哪里?
 
接受答案了.
 
后退
顶部