打开窗口:<br>ShellExecute(Handle, nil, 'http://www.123.com', nil, nil, SW_ShowNormal); <br><br>获得当前IE窗口URL:<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> ShellWindow: IShellWindows;<br> nCount: integer;<br> spDisp: IDispatch;<br> i: integer;<br> vi: OleVariant;<br> IE1: IWebBrowser2;<br> IDoc1: IHTMLDocument2;<br>begin<br> ShellWindow := CoShellWindows.Create;<br> nCount := ShellWindow.Count;<br><br> for i := 0 to nCount - 1 do<br> begin<br> vi := i;<br> spDisp := ShellWindow.Item(vi);<br> spDisp.QueryInterface( iWebBrowser2, IE1 );<br> if IE1 <> nil then<br> begin<br> memo1.Lines.Add( 'Location: '+ie1.LocationName );<br><br> IE1.Document.QueryInterface(IHTMLDocument2,iDoc1);<br> if iDoc1 <> nil then<br> begin<br> memo1.Lines.add( 'Title: ' + IDOC1.Title );<br> memo1.Lines.add( 'Url: ' + IDOC1.url);<br> end;<br> end;<br> end;<br>end;<br>