Khoá màn hình và yêu cầu mật khẩu khi muốn trở lại màn hình làm việc Code: ; | Khoá màn hình và yêu cầu mật khẩu khi muốn trở lại màn hình làm việc Code ----------------------------------------------------- Screen Lock AutoIt Version Author Hallman CWorks HotKeys F9 Close program F10 Change password F11 Enable ScreenLock ----------------------------------------------------- include include Opt TrayMenuMode 1 Dim Atempts 0 Dim Lock 0 Dim PassInput Dim Label Dim ScreenyWindow Dim PassWindow Show_Controls_Timer TimerInit Controls_Shown 0 PassWord RegRead HKEY_LOCAL_MACHINE SOFTWARE Andy ScreenLock Password If PassWord Then PassWord _StringEncrypt 0 PassWord 4471 Else Pass EndIf Lock While 1 msg GUIGetMsg Select Case msg GUI_EVENT_CLOSE And Lock 0 Exit Case msg PassInput If GUICtrlRead PassInput PassWord Then Lock MsgBox 0 Atempts An incorrect password was entered Atempts time s . Atempts 0 Else Atempts 1 SplashMsg Error Invalid Password 220 100 EndIf Case msg GUI_EVENT_PRIMARYUP And Lock 1 GUISetState @SW_SHOW PassWindow Controls_Shown 1 Show_Controls_Timer TimerInit EndSelect If TimerDiff Show_Controls_Timer 10000 And Controls_Shown 1 Then GUISetState @SW_HIDE PassWindow Controls_Shown 0 EndIf If WinExists Windows Task Manager And Lock 1 Then WinClose Windows Task Manager WinKill Windows Task Manager EndIf If WinActive ScreenyWindow 0 And WinActive PassWindow 0 And Lock 1 Then WinActivate ScreenyWindow EndIf If Not BitAND WinGetState ScreenyWindow 2 1 And Lock 1 Then GUISetState @SW_SHOW EndIf If Lock 1 And WinExists ScreenyWindow 0 Then ScreenyWindow GUICreate @DesktopWidth @DesktopHeight -2 -2 WS_POPUPWINDOW WS_EX_TOOLWINDOW GUISwitch ScreenyWindow WinSetTrans ScreenyWindow 1 GUISetState @SW_SHOW ScreenyWindow WinSetOnTop ScreenyWindow 1 WinSetOnTop PassWindow 1 EndIf WEnd Func Lock If Lock 0 Then RegWrite HKEY_CURRENT_USER Software Microsoft Windows CurrentVersion Pol icies System DisableTaskMgr REG_DWORD 00000001 HotKeySet F9 HotKeySet F10 HotKeySet F11 HotKeySet A p Ctrl-Alt-p HotKeySet A l Ctrl-Alt-l .