Sziasztok
A minap keresgélve rá találtam egy szerintem, nagyon jópofa és hasznos programra
Annyi a lényege, hogy lezárja a gépünket az illetéktelenek elõl, mindezt a legegyszerûbb módon!
Egy 4 karakteres szám/betû kombinációt kell megadnunk a konfigurálásnál, és a gépünk már zárolva is van!
Amiket be lehet állítani rajta:
- -> Óra mutatása lezáráskor
- -> iTunes leállítása/elindítása
- -> \'Beep\' hang kiadása, ha rossz jelszót írunk be
- -> e-mail üzenet küldése rossz jelszó beírásánál (elküldi emailbe ha valaki fel akarja törni a gépet, sõt.. azt is hogy melyik kóddal próbálkozott:D)
Szerintem tök jópofa, és egyben hasznos is..
AutoIT3-ban íródott, forráskódja:
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Misc.au3>
#include <String.au3>
#include <Array.au3>
#NoTrayIcon
Opt(\"WinTitleMatchMode\", 4)
If _Singleton(\"OllieB.net-LockPC\", 1) = 0 Then
ProcessClose(\"LockPC.exe\")
ProcessWaitClose(\"LockPC.exe\")
Exit
EndIf
$_VERSION = \'1.2.0\'
$_SETTINGS = \"settings.ini\"
$_CRYPTSTRING = \"lockPCau3ollieb.net\"
Global $_COPYRIGHT = \"LockPC \" & $_VERSION & @CRLF & \"© OllieB.net\"
Global Enum $TIMERID1 = 1001
$winlock = DllOpen(\"WinLockDll.dll\")
If Not FileExists(\"settings.ini\") Then
MsgBox(0, \"Firstrun\", \"Welcome to LockPC, the next step will help you configure LockPC.\" & @CRLF & @CRLF & \"To run this setup again or change your lock code, delete the settings.ini found in the installation directory.\")
CreateSettingsFile()
Else
$_INIVERSION = IniRead(\"settings.ini\", \"app\", \"version\", \'0\')
If $_VERSION <> $_INIVERSION Then
MsgBox(0, \"Error\", \"Your settings file was created in a different version, creating a new one...\")
FileDelete(\"settings.ini\")
CreateSettingsFile()
EndIf
EndIf
Global $passcode = _StringEncrypt(0, IniRead($_SETTINGS, \"set\", \"passcode\", \'0000\'), $_CRYPTSTRING)
Global $itunes_pause_resume = IniRead($_SETTINGS, \"set\", \"itunes_pause_resume\", \'0\')
Global $monitor_idle_off = IniRead($_SETTINGS, \"set\", \"monitor_idle_off\", \'0\')
Global $messenger_contact_list = IniRead($_SETTINGS, \"set\", \"messenger_contact_list\", \'0\')
Global $display_clock = IniRead($_SETTINGS, \"set\", \"display_clock\", \'0\')
Global $beep_on_deny = IniRead($_SETTINGS, \"set\", \"beep_on_deny\", \'0\')
Global $gmail_count = IniRead($_SETTINGS, \"set\", \"gmail_count\", \'0\')
Global $gmail_username = IniRead($_SETTINGS, \"set\", \"gmail_username\", \'0\')
Global $gmail_password = _StringEncrypt(0, IniRead($_SETTINGS, \"set\", \"gmail_password\", \'\'), $_CRYPTSTRING)
If Not IsDeclared(\"SM_VIRTUALWIDTH\") Then Global Const $SM_VIRTUALWIDTH = 78
If Not IsDeclared(\"SM_VIRTUALHEIGHT\") Then Global Const $SM_VIRTUALHEIGHT = 79
$VirtualDesktopWidth = DLLCall(\"user32.dll\", \"int\", \"GetSystemMetrics\", \"int\", $SM_VIRTUALWIDTH)
$VirtualDesktopWidth = $VirtualDesktopWidth[0]
$VirtualDesktopHeight = DLLCall(\"user32.dll\", \"int\", \"GetSystemMetrics\", \"int\", $SM_VIRTUALHEIGHT)
$VirtualDesktopHeight = $VirtualDesktopHeight[0]
Global $_WinWidth=$VirtualDesktopWidth
Global $_WinHeight=$VirtualDesktopHeight
Global $prevleng = 0
Global $mainpassentry
Global $hwnd = WinGetHandle(\"classname=Progman\")
Global $user32 = DllOpen(\"user32.dll\")
Global $last_active = 0
Global $timer = TimerInit()
Global $oiTunes
Global $DELAYTIMER = TimerInit()
Global $DELAY = 3
Global $DELAYTIMER2 = TimerInit()
Global $DELAY2 = 5
Global $new_data = \"Loading...\"
Global $old_data = \"\"
Global $_INFO[1]
HotKeySet(\"{SPACE}\", \"DoNothing\")
HotKeySet(\"{LEFT}\", \"DoNothing\")
HotKeySet(\"{RIGHT}\", \"DoNothing\")
HotKeySet(\"{UP}\", \"DoNothing\")
HotKeySet(\"{DOWN}\", \"DoNothing\")
HotKeySet(\"{TAB}\", \"DoNothing\")
HotKeySet(\"{F1}\", \"DoNothing\")
MainLock()
Func DoNothing()
Return
EndFunc
Func CheckUpdates($_VERSION)
TCPStartup()
$addr = \"ollieb.net\"
$sc = TCPConnect(TCPNameToIP($addr), 80)
$path = \"/apps/lockpc.php?ver=\" & $_VERSION
If @error Or $sc < 1 Then
Return
Else
$request = \"GET \" & $path & \" HTTP/1.0\" & @CRLF & \"Host:\" & $addr & @CRLF & @CRLF
TCPSend($sc, $request)
While 1
$recv = TCPRecv($sc, 1024)
$recv = StringRight($recv, 1)
If @error Then ExitLoop
If $recv <> \"\" Then
If $recv = 1 Then
MsgBox(64, \"Notification\", \"There is an update available for LockPC.\")
EndIf
ExitLoop
EndIf
WEnd
EndIf
TCPShutdown()
EndFunc
Func CheckGmail()
$oHTTP = ObjCreate(\"winhttp.winhttprequest.5.1\")
$oHTTP.Open(\"GET\", \"https://mail.google.com/mail/feed/atom\", False)
$oHTTP.SetCredentials($gmail_username, $gmail_password, 0)
$oHTTP.Send()
$response = $oHTTP.ResponseText
If StringInStr($response, \"<fullcount>\", false) Then
$_COUNT = _StringBetween($response, \"<fullcount>\", \"</fullcount>\")
$_COUNT = Int($_COUNT[0])
$s = \"s\"
If $_COUNT = 0 Then
$_COUNT = \"no\"
ElseIf $_COUNT = 1 Then
$s = \"\"
EndIf
$_RETURN = \"You have \" & $_COUNT & \" new email\" & $s
Else
$_RETURN = \"Gmail Error\"
$_COUNT = False
EndIf
$_INFO[$gmail_count_i] = $_RETURN
EndFunc
Func timerevent($hWnd, $Msg, $iIDTimer, $dwTime)
If $display_clock = 1 Then
GUICtrlSetData($CLOCK, @HOUR & \":\" & @MIN & \":\" & @SEC)
EndIf
If $messenger_contact_list = 1 Then
If Int(TimerDiff($DELAYTIMER)/1000) > $DELAY Then
msnwindowlist()
$DELAYTIMER = TimerInit()
EndIf
EndIf
If $gmail_count = 1 Then
If Int(TimerDiff($DELAYTIMER2)/1000) > $DELAY2 Then
CheckGmail()
$DELAYTIMER2 = TimerInit()
EndIf
EndIf
EndFunc
Func msnwindowlist()
If ProcessExists(\"msnmsgr.exe\") Then
$processes = ProcessList(\"msnmsgr.exe\")
For $i = 1 To $processes[0][0]
$MSNPID = $processes[$i][1]
Next
$var = WinList()
$list = \"\"
For $i = 1 to $var[0][0]
If WinGetProcess($var[$i][0]) = $MSNPID AND $var[$i][0] <> \"Windows Live Messenger\" AND $var[$i][0] <> \"\" AND IsVisible($var[$i][1]) AND StringRight($var[$i][0], 5) <> \"Alert\" Then
$list = $list & $var[$i][0] & @LF
EndIf
Next
If $list = \"\" Then
$_RETURN = \"None \"
Else
$_RETURN = $list
EndIf
$_INFO[$messenger_contact_list_i] = \"Conversation Windows\" & @LF & @LF & $_RETURN
EndIf
Return \"WLM not running \"
EndFunc
Func disableCTRLALTDEL($value)
If $value Then
DllCall($winlock, \"Int\", \"CtrlAltDel_Enable_Disable\", \"Int\", \"0\")
DllCall($winlock, \"Int\", \"TaskSwitching_Enable_Disable\", \"Int\", \"0\")
Else
DllCall($winlock, \"Int\", \"CtrlAltDel_Enable_Disable\", \"Int\", \"1\")
DllCall($winlock, \"Int\", \"TaskSwitching_Enable_Disable\", \"Int\", \"1\")
EndIf
EndFunc
Func IsVisible($handle)
If BitAnd(WinGetState($handle), 2) Then
Return 1
Else
Return 0
EndIf
EndFunc
Func CreateSettingsFile()
$settingsform = GUICreate(\"LockPC\", 266, 360)
GUICtrlCreateGroup(\"Settings\", 8, 8, 249, 300)
$set_pinentry = GUICtrlCreateInput(\"\", 120, 29, 49, 21, $ES_PASSWORD)
GUICtrlSetLimit($set_pinentry, 4)
GUICtrlCreateLabel(\"Create a new PIN:\", 24, 32, 91, 17)
$set_itunes = GUICtrlCreateCheckbox(\"Pause/Play iTunes.\", 24, 64, 193, 17)
$set_monitors = GUICtrlCreateCheckbox(\"Monitors standby after 30s inactivity.\", 24, 96, 193, 17)
$set_beep_on_deny = GUICtrlCreateCheckbox(\"Beep on false entry.\", 24, 128, 193, 17)
$set_messenger_contact_list = GUICtrlCreateCheckbox(\"Display WLM conversation list.\", 24, 160, 193, 17)
$set_display_clock = GUICtrlCreateCheckbox(\"Display clock on lock screen.\", 24, 192, 193, 17)
$set_gmail_count = GUICtrlCreateCheckbox(\"Display G-Mail count.\", 24, 224, 193, 17)
GUICtrlCreateLabel(\"Username:\", 24, 252, 100, 18)
GUICtrlCreateLabel(\"Password:\", 138, 252, 100, 18)
$set_gmail_username = GUICtrlCreateInput(\"\", 24, 270, 100, 21, $ES_READONLY)
$set_gmail_password = GUICtrlCreateInput(\"\", 138, 270, 100, 21, BitOr($ES_PASSWORD, $ES_READONLY))
GUICtrlCreateGroup(\"\", -99, -99, 1, 1)
$set_save = GUICtrlCreateButton(\"Save\", 32, 323, 83, 25, $BS_DEFPUSHBUTTON)
$set_cancel = GUICtrlCreateButton(\"Cancel\", 144, 323, 83, 25, 0)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Switch $msg
Case $set_gmail_count
If BitAnd(GUICtrlRead($set_gmail_count), $GUI_CHECKED) = 1 Then
GUICtrlSetStyle($set_gmail_username, $GUI_SS_DEFAULT_INPUT)
GUICtrlSetStyle($set_gmail_password, $GUI_SS_DEFAULT_INPUT)
Else
GUICtrlSetData($set_gmail_username, \"\")
GUICtrlSetData($set_gmail_password, \"\")
GUICtrlSetStyle($set_gmail_username, $ES_READONLY)
GUICtrlSetStyle($set_gmail_password, $ES_READONLY)
EndIf
Case $set_save
$set_pinentry_r = GUICtrlRead($set_pinentry)
if StringLen($set_pinentry_r) <> 4 Then
MsgBox(0, \"Error\", \"Sorry, your PIN must be exactaly 4 characters\")
ContinueLoop
EndIf
$set_itunes_r = BitAnd(GUICtrlRead($set_itunes), $GUI_CHECKED)
$set_monitors_r = BitAnd(GUICtrlRead($set_monitors), $GUI_CHECKED)
$set_messenger_contact_list_r = BitAnd(GUICtrlRead($set_messenger_contact_list), $GUI_CHECKED)
$set_beep_on_deny_r = BitAnd(GUICtrlRead($set_beep_on_deny), $GUI_CHECKED)
$set_display_clock_r = BitAnd(GUICtrlRead($set_display_clock), $GUI_CHECKED)
$set_gmail_count_r = BitAnd(GUICtrlRead($set_gmail_count), $GUI_CHECKED)
$set_gmail_username_r = GUICtrlRead($set_gmail_username)
$set_gmail_password_r = GUICtrlRead($set_gmail_password)
GUIDelete($settingsform)
ExitLoop
Case $set_cancel
Exit
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
IniWrite($_SETTINGS, \"app\", \"version\", $_VERSION)
IniWrite($_SETTINGS, \"set\", \"passcode\", _StringEncrypt(1, $set_pinentry_r, $_CRYPTSTRING))
IniWrite($_SETTINGS, \"set\", \"itunes_pause_resume\", $set_itunes_r)
IniWrite($_SETTINGS, \"set\", \"monitor_idle_off\", $set_monitors_r)
IniWrite($_SETTINGS, \"set\", \"messenger_contact_list\", $set_messenger_contact_list_r)
IniWrite($_SETTINGS, \"set\", \"beep_on_deny\", $set_beep_on_deny_r)
IniWrite($_SETTINGS, \"set\", \"display_clock\", $set_display_clock_r)
IniWrite($_SETTINGS, \"set\", \"gmail_count\", $set_gmail_count_r)
IniWrite($_SETTINGS, \"set\", \"gmail_username\", $set_gmail_username_r)
IniWrite($_SETTINGS, \"set\", \"gmail_password\", _StringEncrypt(1, $set_gmail_password_r, $_CRYPTSTRING))
if @error <> 0 Then
MsgBox(0, \"Error\", \"There was an error creating the .ini file. Check permissions and location of executable.\"
EndIf
EndFunc
Func _CheckIdle(ByRef $last_active, $start = 0)
$struct = DllStructCreate(\"uint;dword\")
DllStructSetData($struct, 1, DllStructGetSize($struct))
If $start Then
DllCall(\"user32.dll\", \"int\", \"GetLastInputInfo\", \"ptr\", DllStructGetPtr($struct))
$last_active = DllStructGetData($struct, 2)
Return $last_active
Else
DllCall(\"user32.dll\", \"int\", \"GetLastInputInfo\", \"ptr\", DllStructGetPtr($struct))
If $last_active <> DllStructGetData($struct, 2) Then
Local $save = $last_active
$last_active = DllStructGetData($struct, 2)
Return $last_active - $save
EndIf
EndIf
EndFunc
Func _WinAPI_KillTimer($hWnd, $iIDEvent)
Local $iResult = DllCall(\"user32.dll\", \"int\", \"KillTimer\", \"hwnd\", $hWnd, \"int\", $iIDEvent)
If @error Then Return SetError(-1, -1, 0)
Return $iResult[0] <> 0
EndFunc
Func _WinAPI_SetTimer($hWnd, $iIDEvent, $iElapse, $pTimerFunc = 0)
Local $iResult = DllCall(\"user32.dll\", \"int\", \"SetTimer\", \"hwnd\", $hWnd, \"int\", $iIDEvent, \"int\", $iElapse, \"ptr\", $pTimerFunc)
If @error Then Return SetError(-1, -1, 0)
Return $iResult[0]
EndFunc
Func MainLock()
Local $iTimer1, $hCallBack
Global $_MAINGUI = GUICreate(\"LockPC Main\", $_WinWidth,$_WinHeight, 0, 0, 0x80000000, 136)
GUISetCursor(16,1)
GUISetBkColor(0x000000)
$mainpassentry = GUICtrlCreateInput(\"\", -100, -100, 0, 0)
GUICtrlSetLimit($mainpassentry, 4)
;SETUP INFO DISPLAY
If $gmail_count = 1 Then
Global $gmail_count_i = UBound($_INFO)
_ArrayAdd($_INFO, \"\")
CheckGmail()
EndIf
If $messenger_contact_list = 1 Then
Global $messenger_contact_list_i = UBound($_INFO)
_ArrayAdd($_INFO, \"\")
msnwindowlist()
EndIf
;END INFO DISPLAY
$mainimage = GUICtrlCreatePic(\"img/0.jpg\", ((@DesktopWidth/2)-(500/2)), ((@DesktopHeight/2)-(190/2))-50, 0, 0)
;START CLOCK
If $display_clock = 1 Then
Global $CLOCK = GUICtrlCreateLabel(@HOUR & \":\" & @MIN & \":\" & @SEC, ((@DesktopWidth/2)-(400/2)), ((@DesktopHeight/2)-(190/2))/2-(80/2), 400, 80, $SS_CENTER)
GUICtrlSetColor(-1, 0x999999)
GUICtrlSetFont(-1, 30, 600, 0, \"Verdana\")
EndIf
;END CLOCK
;START COPYRIGHT
$COPYRIGHT = GUICtrlCreateLabel(\"LockPC v\" & $_VERSION & @LF & \"© OllieB.net\", 4, 4, 100, 45, 0x)
GUICtrlSetColor(-1, 0x999999)
GUICtrlSetFont(-1, 7)
;END COPYRIGHT
If UBound($_INFO) > 0 Then
Global $_INFOLIST = GUICtrlCreateLabel(\"Loading \", @DesktopWidth-((@DesktopWidth/2)-(500/2)), 4, ((@DesktopWidth/2)-(500/2)), @DesktopHeight-40, $SS_RIGHT)
GUICtrlSetColor(-1, 0x999999)
GUICtrlSetFont(-1, 7)
EndIf
GUISetState(@SW_SHOW, $_MAINGUI)
disableCTRLALTDEL(True)
If $itunes_pause_resume = 1 Then
If ProcessExists(\"itunes.exe\") Then
$oiTunes = ObjCreate(\"iTunes.Application\")
If IsObj($oiTunes) Then
$oiTunes.pause
EndIf
EndIf
If IsObj($oiTunes) Then
$oiTunes.pause
EndIf
EndIf
;SETUP TIMER
$hCallBack = DllCallbackRegister(\"timerevent\", \"none\", \"hwnd;int;int;dword\")
$iTimer1 = _WinAPI_SetTimer($_MAINGUI, $TIMERID1, 500, DllCallbackGetPtr($hCallBack))
While 1
$msg = GUIGetMsg()
If Not WinActive(\"LockPC Main\") Then
WinActivate(\"LockPC Main\")
EndIf
If ControlGetFocus(\"LockPC Main\") <> \"Edit1\" Then
ControlFocus(\"LockPC Main\", \"\", \"Edit1\")
EndIf
If $prevleng <> StringLen(GUICtrlRead($mainpassentry)) Then
GUICtrlSetImage($mainimage, \"img/\" & StringLen(GUICtrlRead($mainpassentry)) & \".jpg\")
$prevleng = StringLen(GUICtrlRead($mainpassentry))
EndIf
$new_data = \"\"
For $i = 1 to UBound($_INFO)-1 Step +1
$new_data = $new_data & $_INFO[$i] & @CR & @CR
Next
If $old_data <> $new_data Then
GUICtrlSetData($_INFOLIST, $new_data)
$old_data = $new_data
EndIf
$not_idle = _CheckIdle($last_active)
If $not_idle <> 0 Then $timer = TimerInit()
If Int(TimerDiff($timer)/1000) > 20 Then
If $monitor_idle_off = 1 Then
DllCall($user32, \"int\", \"SendMessage\", \"hwnd\", $hwnd, \"int\", 274, \"int\", 61808, \"int\", 2)
EndIf
EndIf
Select
Case StringLen(GUICtrlRead($mainpassentry)) = \'4\'
If(GUICtrlRead($mainpassentry) = $passcode) Then
If $itunes_pause_resume = 1 Then
If IsObj($oiTunes) Then
$oiTunes.play
EndIf
EndIf
_WinAPI_KillTimer($_MAINGUI, $iTimer1)
DllCallbackFree($hCallBack)
disableCTRLALTDEL(False)
DllClose($winlock)
Sleep(150)
GUIDelete($_MAINGUI)
HotKeySet(\"{SPACE}\")
HotKeySet(\"{LEFT}\")
HotKeySet(\"{RIGHT}\")
HotKeySet(\"{UP}\")
HotKeySet(\"{DOWN}\")
HotKeySet(\"{TAB}\")
HotKeySet(\"{F1}\")
CheckUpdates($_VERSION)
Exit
Else
GUICtrlSetImage($mainimage, \"img/e.jpg\")
Sleep(150)
If $beep_on_deny = 1 Then
Beep(500, 150)
Beep(200, 350)
Else
Sleep(500)
EndIf
GUICtrlSetData($mainpassentry, \"\")
EndIf
EndSelect
WEnd
EndFunc
Zip Fájl Tartalma, a program, a programhoz tartózó képfájlok.. [AZ \'IMG\' MAPPA LEGYEN A PROGRAM GYÖKERÉBEN!!]
LETÖLTÉS ITT!Tipp:
Ha beteszed az automatikusan induló programok közé, akkor akár azt is megcsinálhatod hogy csak te tudd bekapcsolni a gépet úgymond
Kép a programról:
http://www.picgro.com/image/DnMRemélem hasznát veszitek!