尹
尹兆兵
Unregistered / Unconfirmed
GUEST, unregistred user!
以下取出来的都是scrolltop=0;
var
i,m: Integer;
Browser: IWebBrowser2;
SW : TShellWindows ;
htmldoc: IHTMLDocument2;
Element2: IHTMLElement2;
Event:IHTMLEventObj;
myHTMLWindow2: IHTMLWindow2;
MaxScrollHeight,speed,ScrollHeight:integer;
begin
ListBox1.Clear;
SW := TShellWindows.Create(Application);
try
for i := 0 to SW.Count - 1 do
begin
Browser := SW.Item(i) as IWebBrowser2;
if Browser=nil then continue;
ListBox1.Items.Add(Browser.LocationName);
if Browser.LocationName='新浪首页' then
begin
htmldoc:=Browser.Document as IHTMLDocument2;
Element2:=htmldoc.body as IHTMLElement2;
ListBox2.Items.Add(inttostr(Element2.scrolltop));
ListBox2.Items.Add(inttostr(htmldoc.body.getAttribute('scrollTop', 0)));
end;
end;
finally
SW.Free;
end;
end;
var
i,m: Integer;
Browser: IWebBrowser2;
SW : TShellWindows ;
htmldoc: IHTMLDocument2;
Element2: IHTMLElement2;
Event:IHTMLEventObj;
myHTMLWindow2: IHTMLWindow2;
MaxScrollHeight,speed,ScrollHeight:integer;
begin
ListBox1.Clear;
SW := TShellWindows.Create(Application);
try
for i := 0 to SW.Count - 1 do
begin
Browser := SW.Item(i) as IWebBrowser2;
if Browser=nil then continue;
ListBox1.Items.Add(Browser.LocationName);
if Browser.LocationName='新浪首页' then
begin
htmldoc:=Browser.Document as IHTMLDocument2;
Element2:=htmldoc.body as IHTMLElement2;
ListBox2.Items.Add(inttostr(Element2.scrolltop));
ListBox2.Items.Add(inttostr(htmldoc.body.getAttribute('scrollTop', 0)));
end;
end;
finally
SW.Free;
end;
end;