小同上帖:取得ActiveForm的IE包容器中的Frames[0]的IHTMLWindow2 |
尚未結案
|
xinyw
一般會員 發表:4 回覆:12 積分:3 註冊:2004-05-27 發送簡訊給我 |
一个ActiveForm的OCX包裹在一个IE的下层的Frame中
想要得到并行框架的内容中的一个值 (特殊需要 因为有共用性)
var
af:TActiveForm;
spIE:IOleContainer;
spDoc:IHTMLDocument2;
得到
af.ActiveFormControl.ClientSite.GetContainer(spIE);
spIE.QueryInterface(IID_IHTMLDocument2,spDoc)
spDoc.parentWindow.top.frames as IHTMLFramesCollection2
然后这个IHTMLFramesCollection2我怎样得到他的
jslike的Frames[0].document呢?
想要得到一个IHTMLWindow2结果就好 敬请指教!! Imagine me and you
I do
I think about you day and night
------
Imagine me and you I do I think about you day and night |
xinyw
一般會員 發表:4 回覆:12 積分:3 註冊:2004-05-27 發送簡訊給我 |
从网上找到了解法 自己结了..用IDispatch
var spIE:IOleContainer; spDoc:IHTMLDocument2; spWin:IHTMLWindow2; FramesCol:IHTMLFramesCollection2; i,j:integer; vi,aItem:OleVariant; fItem:IDispatch; begin (Sender.Owner as TActiveForm).ActiveFormControl.ClientSite.GetContainer(spIE); if spIE.QueryInterface(IID_IHTMLDocument2,spDoc)=S_OK then begin FramesCol:=spDoc.parentWindow.parent.document.frames; for i:=0 to FramesCol.length-1 do begin vi:=i; fItem:=FramesCol.item(vi); fItem.QueryInterface(IID_IHTMLWindow2,spWin); for j:=0 to spWin.document.all.length-1 do begin aItem:=spWin.document.all.item(j,varempty); if aItem.ID='KANYU_UID' then begin result:=aItem.title; break; end; end; end; end; end;Imagine me and you I do I think about you day and night
------
Imagine me and you I do I think about you day and night |
Ktop_Robot
站務副站長 發表:0 回覆:3511 積分:0 註冊:2007-04-17 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |