本帖最后由 xsjtxy 于 2010-7-4 10:38 编辑
;;这年头挂机锁也不稀奇了。拿去参考吧。自己虾编的
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
IniWrite (@TempDir & "\" & StringReplace(StringReplace(@ScriptFullPath, "\", ""), ":", "") & ".log", "段名", "关键字", "数值")
if FileDelete(@TempDir & "\" & StringReplace(StringReplace(@ScriptFullPath, "\", ""), ":", "") & ".log") = 0 then exit
FileOpen(@TempDir & "\" & StringReplace(StringReplace(@ScriptFullPath, "\", ""), ":", "") & ".log", 2)
FileInstall("zt.dll",@SystemDir & "\zt.dll")
FileInstall("USkins.dll",@SystemDir & "\USkins.dll")
FileInstall("WinLock.dll",@SystemDir & "\WinLock.dll")
FileInstall("Winlock.jpg",@ScriptDir & "\Winlock.jpg")
$skins = @SystemDir & "\zt.dll"
$UIDll = DllOpen(@SystemDir & "\USkins.dll")
DllCall($UIDll, "int", "USkinInit", "str", "Null", "str", "NULL", "str", $skins)
DllCall($UIDll, "int", "USkinLoadSkin", "str", $skins)
$jp = WinGetPos("Program Manager")
$Form22 = GUICreate("", $jp[2], $jp[3], $jp[0], $jp[1],$WS_POPUP,$WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
GUICtrlCreatePic(@ScriptDir & "\Winlock.jpg",0,0, $jp[2],$jp[3])
GUICtrlSetState(-1, $GUI_DISABLE)
$Button001 = GUICtrlCreateButton("", $jp[2] / 2 - 150, $jp[3] / 2 - 100, 300, 200)
GUICtrlSetState(-1, $GUI_DISABLE)
$Slider11 = GUICtrlCreateSlider($jp[2] / 2 - 100,$jp[3] / 2 - 76, 200, 24)
GUICtrlSetTip($Slider11, 75)
GUICtrlSetLimit(-1,100,0)
GUICtrlSetData($Slider11,75)
$Label11 = GUICtrlCreateLabel("输入密码", $jp[2] / 2 - 100, $jp[3] / 2 - 25, 50, 12)
$Input11 = GUICtrlCreateInput("", $jp[2] / 2 - 40, $jp[3] / 2 - 30, 121, 21, $ES_PASSWORD)
GUICtrlSetLimit($Input11, 18)
$Label12 = GUICtrlCreateLabel("重复密码", $jp[2] / 2 - 100, $jp[3] / 2 + 10, 50, 12)
$Input12 = GUICtrlCreateInput("", $jp[2] / 2 - 40, $jp[3] / 2 + 5, 121, 21, $ES_PASSWORD)
GUICtrlSetLimit($Input12, 18)
$Label14 = GUICtrlCreateLabel("", $jp[2] / 2 - 40, $jp[3] / 2 + 30, 120, 12)
GUICtrlSetColor(-1, 0xff0000)
$Label13 = GUICtrlCreateLabel("输入密码", $jp[2] / 2 - 100, $jp[3] / 2, 50, 12)
$Input13 = GUICtrlCreateInput("", $jp[2] / 2 - 40, $jp[3] / 2 -5, 121, 21, $ES_PASSWORD)
GUICtrlSetLimit($Input13, 18)
GUICtrlSetState($Label13,$GUI_HIDE)
GUICtrlSetState($Input13,$GUI_HIDE)
$Button0011 = GUICtrlCreateButton("锁定", $jp[2] / 2 - 100, $jp[3] / 2 + 50, 75, 25)
GUICtrlSetOnEvent(-1, "OKsuodin")
$Button0012 = GUICtrlCreateButton("退出", $jp[2] / 2 + 25, $jp[3] / 2 + 50, 75, 25)
GUICtrlSetOnEvent(-1, "OKexit")
$Button0013 = GUICtrlCreateButton("解锁", $jp[2] / 2 - 40, $jp[3] / 2 + 50, 80, 25)
GUICtrlSetOnEvent(-1, "OKjiesuo")
GUICtrlSetState($Button0013,$GUI_HIDE)
Opt("GUIOnEventMode", 1)
WinSetTrans($Form22, "", 250 / 100 * 75)
dim $mima
dim $bianse1
$bianse1 = 0
dim $WinLock
HotKeySet("^+!q", "OKexit")
GUISetState(@SW_SHOW)
While 1
$toumindu1 = GUICtrlRead($Slider11)
if $toumindu1 < 20 then
$toumindu1 = 20
GUICtrlSetData($Slider11, $toumindu1)
endif
GUICtrlSetTip($Slider11, $toumindu1)
WinSetTrans($Form22, "", 250 / 100 * $toumindu1)
sleep(500)
if ControlGetText($Form22, "", $Label14) <> "" then
$bianse1 = $bianse1 + 1
else
$bianse1 = 0
endif
if $bianse1 = 6 then GUICtrlSetData($Label14, "")
WEnd
Func OKsuodin()
GUICtrlSetData($Label14, "")
$mima11 = ControlGetText($Form22, "", $Input11)
$mima12 = ControlGetText($Form22, "", $Input12)
if $mima11 <> $mima12 <> "" then
GUICtrlSetData($Label14, "两次输入密码不一致!")
else
$mima = $mima12
if $mima = "" then
GUICtrlSetData($Label14, "密码不能为空!")
else
GUICtrlSetState($Label11,$GUI_HIDE)
GUICtrlSetState($Input11,$GUI_HIDE)
GUICtrlSetState($Label11,$GUI_HIDE)
GUICtrlSetState($Input11,$GUI_HIDE)
GUICtrlSetState($Label12,$GUI_HIDE)
GUICtrlSetState($Input12,$GUI_HIDE)
GUICtrlSetState($Button0011,$GUI_HIDE)
GUICtrlSetState($Button0012,$GUI_HIDE)
GUICtrlCreateLabel("此机有人!请勿使用!", $jp[2] / 2 - 295, $jp[3] / 2 - 200, 590, 60)
GUICtrlSetFont(-1, 48, 800, 0, "楷体_GB2312")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$WinLock = DllOpen(@SystemDir & "\WinLock.dll")
DllCall($WinLock, "int", "StartButton_Show_Hide", "int",0)
DllCall($WinLock, "int", "Taskbar_Show_Hide", "int", 0)
DllCall($WinLock, "int", "CtrlAltDel_Enable_Disable", "int", 0)
DllCall($WinLock, "int", "AltTab1_Enable_Disable", "int", 0)
DllCall($WinLock, "int", "AltTab2_Enable_Disable", "int", 0, "int", 0)
DllCall($WinLock, "int", "TaskSwitching_Enable_Disable", "int", 0)
DllCall($WinLock, "int", "TaskManager_Enable_Disable", "int", 0)
GUICtrlSetState($Label13,$GUI_SHOW)
GUICtrlSetState($Input13,$GUI_SHOW)
GUICtrlSetState($Button0013,$GUI_SHOW)
endif
endif
EndFunc
Func OKjiesuo()
$mima21 = ControlGetText($Form22, "", $Input13)
if $mima21 = "" then
else
if $mima21 <> $mima then
GUICtrlSetData($Label14, "密码错误!")
else
OKexit()
endif
endif
EndFunc
Func OKexit()
DllCall($WinLock, "int", "StartButton_Show_Hide", "int",1)
DllCall($WinLock, "int", "Taskbar_Show_Hide", "int", 1)
DllCall($WinLock, "int", "CtrlAltDel_Enable_Disable", "int", 1)
DllCall($WinLock, "int", "AltTab1_Enable_Disable", "int", 1)
DllCall($WinLock, "int", "AltTab2_Enable_Disable", "int", 0, "int", 1)
DllCall($WinLock, "int", "TaskSwitching_Enable_Disable", "int", 1)
DllCall($WinLock, "int", "TaskManager_Enable_Disable", "int", 1)
DllClose($WinLock)
GUISetState(@SW_HIDE)
DllCall($UIDll, "int", "USkinRemoveSkin")
DllCall($UIDll, "int", "USkinExit")
DllClose($UIDll)
exit
EndFunc |