![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Frame [D7]
Леопольд (К) © (2003-05-22 19:36:00)Можно ли в TWebBrowser"е остановить один фрейм из двух?
Ihor Osov'yak (2003-05-25 14:13:00) [1]Ниже фрагмент кода для рекурсивной пробежки по фреймам.
Обрати внимание на IWindow2:IHTMLWindow2; и на то, что
IHTMLWindow2 имеет метод Get_name.
Сделайте маленькую модернизацию этого кода - и дело в шляпе..
type
TOneStepSearchCondForHtmlDocWithFrames = function (iDoc:IHtmlDocument2; addPrm:integer):boolean;
function FinderFirstCondForHtmlDocWithFrames(iDoc:IHtmlDocument2;
addPrm:integer;
aDoer:TOneStepSearchCondForHtmlDocWithFrames):boolean;
{ The procedure aDoer will be caused for each IHtmlDocument2, beginning
from main and finishing any level of frames
while aDoer will return false;
}
var frames:IHTMLFramesCollection2;
i:integer;
ov1:OleVariant;
iDisp:IDispatch;
IWindow2:IHTMLWindow2;
begin
result := false;
if not assigned(aDoer) then Exit;
result:=aDoer(iDoc,addPrm);
if result then Exit;
frames:=iDoc.frames;
if not assigned(frames) then exit;
if frames.length=0 then exit;
//i:= frames.length;
//Writeln("i=",IntToStr(i));
for i:=1 to frames.length do begin
ov1:=i-1;
try
iDisp:=frames.item(ov1);
iDisp.QueryInterface(IHTMLWindow2,IWindow2);
if assigned(IWindow2)
then begin
result := false;
try
if assigned(IWindow2.document)
then
result := FinderFirstCondForHtmlDocWithFrames(IWindow2.document,addPrm,aDoer);
except
end;
if result then exit;
end;
except
{ ShowMessage("Find error !!!");}
end;
end;
end;
Леопольд (К) (2003-05-23 21:25:00) [2]Как же получить интерфейс к фрейму с name="menu"?
Леопольд (К) (2003-05-23 17:52:00) [3]А можно примерчик?
Ihor Osov'yak (2003-05-22 21:42:00) [4]Можно. Получаешь интерфейс IWebBrowser2 к соотв. фрейму и юзаешь метод Stop.