标题: [问题求助] hta检测窗口是否活动 [打印本页]
作者: czjt1234 时间: 2015-8-19 14:05 标题: hta检测窗口是否活动
被几个事件搞晕了头- <html>
-
- <head>
- <hta:Application
- ID = "oHTA"
- ContextMenu = "No"
- Border = "None"
- ShowInTaskBar = "No"
- ApplicationName = "192.168.0.251"
- SingleInstance = "Yes"
- WindowState = "Maximize"
- Version = "1.5"
- Scroll = "No"
- >
-
- <script language=vbscript>
- Sub focus()
- userid.focus()
- xx.innerText = "活动"
- End Sub
- Sub blur()
- xx.innerText = "不活动"
- End Sub
- Sub check()
- xx.innerText = "不活动"
- End Sub
- </script>
-
- </head>
-
- <body onfocus="focus()" onblur="blur()" style="background:#80BFFF;">
-
- <div style="position:absolute;left:40%;top:30%;">
- <label for="userid" style="width:60px;">卡号</label>
- <input type="text" id="userid" style="width:200px;" />
- <br /><br />
- <label for="userpassword" style="width:60px;">口令</label>
- <input type="password" id="userpw" style="width:200px;" />
- <br /><br />
- <label for="adminpassword" style="width:60px;">管理员</label>
- <input type=password id="adminpw" style="width:200px;" />
- <br /><br />
- <button style="position:absolute;right:0px;" onclick="check()">确定</button>
- <br /><br /><br />
- <label id="xx" style="width:260px;color:red;font-Weight:bold;"></label>
- </div>
-
-
- </body>
-
- </html>
复制代码
意图:当窗口被关闭或被最小化时,或按开始菜单,窗口不活动时,触发事件
防止别人跳过输入窗口
作者: CrLf 时间: 2015-8-19 15:36
hta 是不响应 onquit 的
作者: czjt1234 时间: 2015-8-19 16:00
我是用一个vbs保护hta
设置环境变量判断是否为活动窗口
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |