Earth - A Sample Programm Created with Script2EXE
A window does't has to be square.
This program shows how to make a round window.
HTML Source
<HTML>
<HEAD>
<script language="javascript">
function Init()
{
if(!window.external.SHW)
return;
window.external.ResizeClientTo(114, 106);
window.external.AllowContextMenu(false);
// Calculate a circle's points
var rg="";
var rg0="";
for(var d=0; d<=360; d+=5)
{
var r=(Math.PI/180)*d;
var x=parseInt(48 * Math.cos(r)) + 59;
var y=parseInt(48 * Math.sin(r)) + 53;
var p=x.toString() + "," + y.toString() + "\r\n";
rg+=p;
if(d==0)
rg0=p;
}
rg+=rg0; // add the first point to close the circle
//Set the window shape to the circle
window.external.SetWindowRgn(rg, true);
}
Init();
//Display menu when user right click the earth
function menu()
{
if(!window.external.SHW)
return;
if(window.event.button!=2)
return;
var menu=window.external.CreateMenu();
menu.AddItem("About...");
menu.AddItem("");
menu.AddItem("Exit");
var s=menu.Show();
if(!s)
return;
if(s=="Exit")
{
window.close();
return;
}
if(s=="About...")
{
var r=window.external.MessageBox("This program is created with Script2EXE by XUEBROTHERS.\r\n\r\nWould you like to visit the Web site of Script2EXE?", "yesno", "information", "Earth");
if(r=="yes")
window.external.ShellExecute("http://www.xuebrothers.net/sh/sh.htm");
return;
}
}
</script>
</HEAD>
<BODY leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" bgColor="#000000" scroll="no">
<img src="earth.gif" title="Right click to show menu." onmousedown="menu()">
</BODY>
</HTML>