用window.createPopup()成功实现了在桌面显示一个无窗口的flash.
将下面的代码,保存为qq.hta,双击运行即可。关闭方法,任务管理器中关闭mshta.exe即可。
代码如下:
APPLICATIONNAME="myApp" BORDER="none" CAPTION="no" ICON="filename.ico" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="no" SHOWINTASKBAR="no" INGLEINSTANCE="no" SYSMENU="no" VERSION="1.0" WINDOWSTATE="minimize" /> function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); var imagewidth=200 //这两行写弹出窗口的大小 var imageheight=200 var speed=3; var isie=0; if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) { isie=1; } else { isie=0; } function pop() { if(isie) { x=x+dx;y=y+dy; oPopup.show(x, y, imagewidth, imageheight); if(x+imagewidth+5>screen.width) dx=-dx; if(y+imageheight+5>screen.height) dy=-dy; if(x<0) dx=-dx; if(y<0) dy=-dy; startani=setTimeout("pop();",50); } } if(isie) { var str=''; var x=0,y=0,dx=speed,dy=speed; var oPopup = window.createPopup(); var oPopupBody = oPopup.document.body; //oPopup.document.bgColor="orange"; //桔黄色背景颜色 oPopup.document.bgColor="#ffffff"; //白色背景 oPopupBody.innerHTML = str; pop(); } 更多信息请查看IT技术专栏