锁屏源码
- ; ----------------------------------------------------------------------------
- ;
- ; 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
复制代码
|