控制IE:(祥见174557)
Uses
SHDocVw,MSHTML;
procedure TForm1.Button1Click(Sender: TObject);
var
ShellWindow: IShellWindows;
nCount: integer;
spDisp: IDispatch;
i: integer;
vi: OleVariant;
IE1: IWebBrowser2;
IDoc1: IHTMLDocument2;
begin
ShellWindow := CoShellWindows.Create;
nCount := ShellWindow.Count;
for i := 0 to nCount - 1 do
begin
vi := i;
spDisp := ShellWindow.Item(vi);
spDisp.QueryInterface( iWebBrowser2, IE1 );
//或者用: IE1 := spDisp as IWebBrowser2;
if IE1 <> nil then
begin
IE1.GoBack;
end;
end;
end;