第一步:准备一张背景图片,作为桌面的背景,我准备的图片是C:\Documents and Settings\Administrator\My Documents\My Pictures\229096.jpg
第二步:编写Js网页脚本,以下是我编写的网页的全部内容:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
background-color: #C4E4FF;
background-image: url([url=file:///C|/Documents%20and%20Settings/Administrator/My%20Documents/My%20Pictures/229096.jpg]file:///C|/Documents%20and%20Settings/Administrator/My%20Documents/My%20Pictures/229096.jpg[/url]);
}
.STYLE1 {color: #FFFFFF}
-->
</style>
<script language="javascript" type="text/javascript">
function test()
{
if(binhua.value=="") //如果搜索文本框没有输入,就返回.
{
return false;
}
var url="";
for(var i=0;i<type.length;i++) //递归查找单选按钮所选择的值.
{
if(type
.checked==true)
{
url = type.value;
break;
}
}
window.open(url+binhua.value); //打开搜索页面
}
function SubmitEvent(event)
{
event = event || window.event;
if(event.keyCode==13) //回车键进行搜索
{
test();
}
}
document.oncontextmenu=function(){
binhua.value="";return false; //鼠标右击清空搜索框
}
</script>
</head>
<body>
<div class="STYLE1" style="text-align:right; margin-top:690px; width:100%">
<input name="type" type="radio" value="http://">
网页
<input type="radio" name="type" value="http://www.baidu.com/s?cl=3&wd=">
百度
<input name="type" type="radio" value="http://www.google.cn/search?hl=zh-CN&btnG=Google+%E6%90%9C%E7%B4%A2&meta=&aq=f&q=" checked="checked">
Google
<!--设置搜索引擎参数,这里设置的第一个是打开一个空白页,第二个是百度搜索引擎,第三个的Google搜索引擎,你可以根据自己的喜好设置其他的.-->
<input name="binhua" type="text" id="binhua" onkeydown="SubmitEvent(event);" size="14">
<input type="button" name="Submit" value="Go" >
</div>
</body>
</html>
将以上的内容保存成名为"bg.htm"的文件.
第三步:将刚保存的"bg.htm"文件设置为桌面背景,效果如下图

桌面搜索在桌面的右下角...