|
将下面代码保存为notepad.hta文件:
<HTML>
<HEAD>
<TITLE>记事本</TITLE>
<HTA:APPLICATION ID="oHTA" APPLICATIONNAME="myApp" BORDER="thick" BORDERSTYLE="normal" CAPTION="yes"
ICON="notepad.exe" MAXIMIZEBUTTON="yes" MINIMIZEBUTTON="yes" SHOWINTASKBAR="yes" SINGLEINSTANCE="no"
SYSMENU="yes" VERSION="1.0" WINDOWSTATE="normal" NAVIGABLE="yes" SCROLL="no" INNERBORDER="no">
<style>
.menu{font-size:9pt;padding-top:4px;padding-right:4px;padding-bottom:2px;padding-left:4px;}
textarea{height:expression(document.body.clientHeight-menu.clientHeight-1);width:100%;}
.menuhelp{position:absolute;top:21px;border-width:1;border-style:solid;visibility:hidden;
border-top-color:Menu;border-left-color:Menu;border-bottom-color:black;border-right-color:black}
.popmenu{padding-top:4px;padding-right:20px;padding-bottom:4px;padding-left:20px;
border-width:1;border-style:solid;border-bottom-color:gray;border-right-color:gray}
</style>
<script>
function nosel()
{
window.event.returnValue=false;
}
function showmenu(menuid)
{
switch(menuid)
{
case 1:popopen.style.visibility="visible";break;
case 2:popedit.style.visibility="visible";break;
case 3:break;
case 4:pophelp.style.visibility="visible";break;
}
}
function hidemenu()
{
pophelp.style.visibility="hidden";
popopen.style.visibility="hidden";
popedit.style.visibility="hidden";
}
function selall()
{
var rng = workshop.createTextRange();
rng.moveToElementText(workshop);
rng.scrollIntoView();
rng.select();
rng.collapse(false);scrollTo(0,0);
}
function copytext()
{
var rng = workshop.createTextRange();
rng.moveToElementText(workshop);
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
scrollTo(0,0);
}
fso = new ActiveXObject("Scripting.FileSystemObject");
fn=null;
function opendialog()
{
fn=prompt("输入你要打开的文件路径:","notepad.hta");
if(fn!=null)
{
var file = fso.OpenTextFile(fn);
var filetext = file.ReadAll();
workshop.value=filetext;
}
}
function savefile()
{
if(fn!=null)
{
var file = fso.CreateTextFile(fn,true);
file.Write(workshop.value);
file.close();
}
}
function saveas()
{
var fntmp=prompt("输入你要保存的文件路径:",fn);
if(fntmp!=null)
{
fn=fntmp;
var file = fso.CreateTextFile(fn,true);
file.Write(workshop.value);
file.close();
}
}
</script>
</HEAD>
<BODY leftmargin=0 rightmargin=0 topmargin=0 id=form bgcolor="Menu">
<table oncontextmenu="nosel()" onselectstart="nosel()" id=menu align=center bgcolor=Menu border=0 width=100% cellpadding=0 cellspacing=0 style="border-collapse: collapse">
<tr>
<td width=220>
<table class=menu width=220 border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" onmouseover="this.style.cursor='default'">
<tr>
<td align=center id=file width=55 onclick="hidemenu();showmenu(1)">文件<font face="MS Gothic">(F)</font></td>
<td align=center id=edit width=55 onclick="hidemenu();showmenu(2)">编辑<font face="MS Gothic">(E)</font></td>
<td align=center id=option width=55 onclick="hidemenu();showmenu(3)">格式<font face="MS Gothic">(O)</font></td>
<td align=center id=option width=55 onclick="hidemenu();showmenu(4)">帮助<font face="MS Gothic">(H)</font></td>
</tr>
</table>
</td>
<td align=left onclick=hidemenu() style=color:Menu onmouseover=this.style.cursor='default'>Create by:tabris17</td>
</tr>
</table>
<div class=menuhelp id=pophelp style="left:165px;">
<table onselectstart="nosel()" onmouseover="this.style.cursor='default'" class=popmenu border=0 bgcolor=Menu cellpadding=0 cellspacing=1 style=border-collapse: collapse style="font-size:9pt">
<tr><td onclick="hidemenu();window.open('http://www.20cn.net/~tabris17');" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">帮助主题<font face="MS Gothic">(H)</font></td></tr>
<tr><td style="line-height:0;padding-left:1;padding-right:1;padding-bottom:0;padding-top:0;"><hr width=116></td></tr>
<tr><td onclick="hidemenu();alert('Copyleft:tabris17');" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">关于记事本<font face="MS Gothic">(A)</font></td></tr>
</table>
</div>
<div class=menuhelp id=popopen style="left:0px;">
<table onselectstart="nosel()" onmouseover="this.style.cursor='default'" class=popmenu border=0 bgcolor=Menu cellpadding=0 cellspacing=1 style=border-collapse: collapse style="font-size:9pt">
<tr><td onclick="hidemenu();opendialog();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">打开<font face="MS Gothic">(O)</font></td></tr>
<tr><td onclick="hidemenu();savefile();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">保存<font face="MS Gothic">(S)</font></td></tr>
<tr><td onclick="hidemenu();saveas();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">另保为<font face="MS Gothic">(A)</font>...</td></tr>
<tr><td onclick="hidemenu();workshop.value='';fn=null;" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">关闭<font face="MS Gothic">(C)</font></td></tr>
<tr><td style="height:1px;padding-left:1;padding-right:1;padding-bottom:0;padding-top:0;"><hr width=100></td></tr>
<tr><td onclick="hidemenu();window.close();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">退出<font face="MS Gothic">(X)</font></td></tr>
</table>
</div>
<div class=menuhelp id=popedit style="left:55px;">
<table onselectstart="nosel()" onmouseover="this.style.cursor='default'" class=popmenu border=0 bgcolor=Menu cellpadding=0 cellspacing=1 style=border-collapse: collapse style="font-size:9pt">
<tr><td onclick="hidemenu();selall()" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">全选<font face="MS Gothic">(A)</font></td></tr>
<tr><td onclick="hidemenu();copytext()" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">复制全部<font face="MS Gothic">(C)</font></td></tr>
</table>
</div>
<textarea style="font-family:Fixedsys;" id=workshop application=yes scrolling=yes width=100% onclick="hidemenu()"></textarea>
</BODY>
</HTML>
posted on 2004年06月01日 8:50 PM |
|