//跨域框架操作方法二

import win.ui;
/*DSG{{*/
var winform = win.form(parent=...; bottom=486;scroll=1;right=665;text="AAuto Form" )
winform.add(  )
/*}}*/

import web.form;

//创建web窗体
var wb = web.form( winform 
    ,//可输入_UIFLAG_ 前缀的常量自定义外观
    ,0x40000000/*_DLCTL_SILENT*/
    );


//打开目标网站
wb.go("http://www.bianmin114.com/")
//显示窗体
winform.show()  
wb.wait("");//等待指定网址,可以使用模式匹配语法

import com.interface.IServiceProvider;
queryBrowser = function(window){
	var service = com.interface( window,com.interface.IServiceProvider) 
	var hr,obj = service.QueryService( 
		win.guid.fromString("{0002DF05-0000-0000-C000-000000000046}")
		,win.guid.fromString("{D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}")
		)
	com.interface.checkError(hr)
	return com.QueryObject(obj )
}
 
frames = wb.getDoc().frames;

//遍历所有框架
for(i=1;frames.length ;1){ 
	browser = queryBrowser(frames(i-1) )
	browser.Document().Body.InnerHTML   = "跨域操作框架" 

}
 

//进入消息循环
win.loopMessage();
return winform,wb;
