最新消息:

AutoIt Forums _ Example Scripts _ Phony Windows Lock-Out

autoit 永恒心锁 2599浏览 0评论

I use AutoIt a lot when I am at work, but I like to lock my computer using the (WinKey + L) when I am away from my desk. I needed a way to let my AutoIt apps and scripts run while I am away form my deak for maximum use of the automation, without appearing like the computer is “doing something magical” or looking like it is open to people stopping by to read my email…

Enter the Phony Windows Lock-Out. This is just a VERY basic GUI script that will make it look like the computer has been locked, while it’s not really locked at all, therefore allowing your apps to run and not be stopped by windows.

This was put together quickly, so there may be issues, but I know it’s something that I need so maybe you do too.

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.1 (beta)
; Language: English
; Platform: WinXP
; Author: Cybie
;
; Script Function:
; Fake the "computer locked" dialog so that AutoIt may run in the background.
;
; ----------------------------------------------------------------------------
#include <GuiConstants.au3>
HotKeySet("{F2}","KillSwitch")

$LockImage = @TempDir & "/" & "locked.jpg"
FileInstall("locked.jpg", $LockImage, 1)
$SecurityImage = @TempDir & "/" & "security.jpg"
FileInstall("security.gif", $SecurityImage, 1)

$username = "MKTNG\yourname (Your Name)"

; GUI looks like background.
GuiCreate("x", @DesktopWidth, @DesktopHeight, -1, -1, 0x80000000)
GUISetBkColor (0x6E8ADE)
GuiSetState()

GUICreate("Computer Locked", 400, 200, -1, -1, 0x00000000)
GUISetBkColor (0xE0E0C0)
GUICtrlCreatePic ($LockImage, 0, 0, 400, 75)
GUICtrlCreatePic ($SecurityImage, 10, 85, 32, 25)
GUICtrlCreateLabel("This computer is in use and has been locked.",52,85,325,20)
GUICtrlCreateLabel("Only " & $username & " or an administrator can unlock this computer.",52,105,325,40)
GUICtrlCreateLabel("Press Ctrl-Alt-Del to unlock this computer.",52,145,325,20)
GUISetState()

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
 $msg = GUIGetMsg()
;Keeps the computer from actually locking due to inactivity.
 $RandomMoveX = Random (1, @DesktopWidth)
 MouseMove ($RandomMoveX, @DesktopHeight)
 $RandomTime = Random (5000, 10000)
 Sleep($RandomTime)
 WinActivate("x")
 WinActivate("Computer Locked")
Wend

;FUNCTIONS
;---------
Func KillSwitch()
 Exit 0
EndFunc
免责声明:根据《计算机软件保护条例》第十七条规定“为了学习和研究软件内含的设计思想和原理,通过安装、显示、传输或者存储软件等方式使用软件的,可以不经软件著作权人许可,不向其支付报酬。”您需知晓本站所有内容资源均来源于网络,仅供用户交流学习与研究使用,版权归属原版权方所有,版权争议与本站无关,用户本人下载后不能用作商业或非法用途,需在24个小时之内从您的电脑中彻底删除上述内容,否则后果均由用户承担责任;如果您访问和下载此文件,表示您同意只将此文件用于参考、学习而非其他用途,否则一切后果请您自行承担,如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。丨本站为个人博客非盈利性站点,所有软件信息均来自网络,所有资源仅供学习参考研究目的,并不贩卖软件,不存在任何商业目的及用途。丨本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » AutoIt Forums _ Example Scripts _ Phony Windows Lock-Out

您必须 登录 才能发表评论!