当前位置:网站首页>HTA入门基础教程 | VBS脚本的GUI界面 HTA简明教程 ,附带完整历程及界面美化
HTA入门基础教程 | VBS脚本的GUI界面 HTA简明教程 ,附带完整历程及界面美化
2022-06-30 02:37:00 【CDamogu】
背景知识
HTA是 HTML Application的缩写(HTML应用程序),是软件开发的新概念,直接将HTML保存成HTA的格式,就是一个独立的应用软件,与VB、C++等程序语言所设计的软件界面没什么差别。
- HTA与普通的网页结构差不多,所以设计出来很容易,当然HTA还有许多自己独特的属性:
- HTA 虽然用HTML、JS和CSS编写,却比普通网页权限大得多。
- HTA 具有桌面程序的所有权限(读写文件、操作注册表等),HTA本来就是被设计为桌面程序的。
- HTA对语法的要求比HTML还要松,甚至连
<html>、<body>等标记都可以省略: - 可以用
<HTA:Application>来设定HTA应用程序的外观,如标题栏、边框大小等,必须放在中。
属性一览
推荐html表格代码生成 https://www.tablesgenerator.com/html_tables
由于CSDN无法展示样式 ,故以截图形式展示,阅读更直观,下述表格源文件 CSDN下载-HTA.tgn ,下载后打开上述链接,点击File,Load Table即可
界面效果
效果如下:LOGO+公司LOGO自行添加链接即可,以下仅为从网上寻找的图片添加,若造成任何侵权请告知删除.
代码
新建文件,并命名为 Example.hta 即可在Windows中直接打开使用
<html>
<head>
<title style="padding: 1px;margin: 1px;"> HTA Example GUI</title>
<meta content="text/html;charset=utf-8" style="background:Aqua;text-align:center;">
<HTA:APPLICATION ID="oHTA" APPLICATIONNAME="myApp" ICON="http://stackoverflow.com/favicon.ico"/>
<img src=" https://m-todo.gitee.io/m-todo-img/logo/bosch/BOSCH.png" style="width:17%;"></img>
<img src=" https://m-todo.gitee.io/m-todo-img/logo/bosch/BoschHuayu.png" style="width:25%;"></img>
</head>
<script> window.resizeTo(1500,500); var fso; var wsh; fso = new ActiveXObject("Scripting.FileSystemObject"); wsh = new ActiveXObject("WScript.Shell"); function checkcli(e){
fso.GetStandardStream(1).Write(e.type); window.close(); } function Run(strPath){
wsh.Run(strPath,1,true); } function Close(){
window.close(); } function Web(){
wsh.Run("cmd.exe /k start firefox http://www.dooccn.com/c/ &&\ echo complete"); } function MakeHexOnly(){
wsh.Run("cmd.exe /k C: && cd C:/Users/test && OnlyHex.bat &&\ echo The Hex Documents are saved in C:\Users\test "); } function MakeComplete(){
wsh.Run("cmd.exe /k C: && cd C:/Users/test && CompleteHex.bat &&\ echo The Hex Documents are saved in C:\Users\test "); } </script>
<style> body {
padding:0; margin:0;} ul {
list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; position: fixed; top: 0; width: 100%; } li {
float: left; } li a {
display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover {
background-color: #4CAF50; color: white; } .labeltxt {
background-color: #480000; } h1{
font-family:"Times New Roman",Georgia,Serif; } </style>
<body style="background:light; text-align:left; padding: 1px;margin: 1px;" SCROLL="no">
<meta content="text/html;charset=utf-8" style="background:Aqua; text-align:left;">
<ul>
<li class="labeltxt"><a href="#">快捷方式</a></li>
<li onclick="Run('file:///C:/Program%20Files%20(x86)/Microsoft%20Office/Office16/Outlook.exe')"><a href="#">快捷方式1</a></li>
<li onclick="Run('file:///C:/Program%20Files%20(x86)/Microsoft%20Office/Office16/Outlook.exe')"><a href="#">快捷方式2</a></li>
<li onclick="Run('file:///C:/Program%20Files%20(x86)/Microsoft%20Office/Office16/Outlook.exe')"><a href="#">快捷方式3</a></li>
<li onclick="Run('file:///C:/Program%20Files%20(x86)/Microsoft%20Office/Office16/Outlook.exe')"><a href="#">快捷方式4</a></li>
<li onclick="Run('file:///C:/Program%20Files%20(x86)/Microsoft%20Office/Office16/Outlook.exe')"><a href="#">快捷方式5</a></li>
<li onclick="Run('file:///C:/Program%20Files%20(x86)/Microsoft%20Office/Office16/Outlook.exe')"><a href="#">快捷方式6</a></li>
<li onclick="Run('file:///C:/Program%20Files%20(x86)/Microsoft%20Office/Office16/Outlook.exe')"><a href="#">快捷方式7</a></li>
<li onclick="Web()"><a href="#">快捷方式8</a></li>
</ul>
<div style="padding:0px;margin-top:02px;background-color:#C0C0C0;height:800px;">
<ul>
<li class="labeltxt"><a href="#">调用脚本</a></li>
<li onclick="MakeHexOnly()"><a href="#">调用程序1</a></li>
<li onclick="MakeComplete()"><a href="#">调用程序2</a></li>
</ul>
<div style="padding:0px;margin-top:02px;background-color:#C0C0C0;height:800px;">
<ul>
<li class="labeltxt"><a href="#">关闭程序</a></li>
<li onclick="Close()"><a href="#Close">关闭</a></li>
</ul>
<div style="padding:0px;margin-top:02px;background-color:#C0C0C0;height:800px;">
<MARQUEE>Hello Mushroomer</B><br><br>
</body>
</html>
边栏推荐
- AutoJS代碼能加密嗎?YES,AutoJS加密技巧展示
- Global and Chinese markets for light cargo conveyors 2022-2028: Research Report on technology, participants, trends, market size and share
- DigiCert Smart Seal是什么?
- 归并排序
- IBM WebSphere channel connectivity setup and testing
- How to display all keys through redis cli- How to show ALL keys through redis-cli?
- JS advanced -h5 new features
- DHU programming exercise
- PMP考生如何应对新考纲?看过来!
- 选购通配符SSL证书注意事项
猜你喜欢

微信小程序页面跳转以及参数传递

Unity TimeLine 数据绑定

What is a self signed certificate? Advantages and disadvantages of self signed SSL certificates?

Seven common errors of SSL certificate and their solutions

Several key points recorded after reviewing redis design and Implementation

What is the difference between a layer 3 switch and a layer 2 switch

How to prevent phishing emails? S/mime mail certificate

DigiCert Smart Seal是什么?

Sitelock nine FAQs

Shell Sort
随机推荐
JS advanced -h5 new features
速看 2021-2022年23项重大网络犯罪统计数据
Global and Chinese market of relay lens 2022-2028: Research Report on technology, participants, trends, market size and share
FDA ESG规定:必须使用数字证书保证通信安全
What is digicert smart seal?
Dynamic SQL
[NPM] solve the problem of error reporting when installing typeorm with NPM
Bubble sort
What are the requirements for NPDP product manager international certification examination?
Network neuroscience -- a review of network Neuroscience
SSL证书格式转化的两种方法
Recommendations for agileplm database parameter optimization
隐藏在科技教育中的steam元素
Alphassl digital certificate
Global and Chinese market of ERP software for garment and textile industries 2022-2028: Research Report on technology, participants, trends, market size and share
Heap sort
2022 the action of protecting the net is imminent. Things about protecting the net
Recheck on February 15, 2022
Seven common errors of SSL certificate and their solutions
Pytoch learning (II)