Pc locker

08/26/2013 00:36 kimboy600#1
Hi everyone , i decided to share some little home-made creation.
This is a pc locker.
HTML Code:
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3> 
#include <ScreenCapture.au3>
Opt ("GuicloseOnEsc",1)
$SW = @DesktopWidth
$SH = @DesktopHeight
MsgBox (0,"Slider","Combination is '100,'20','70'")


_ScreenCapture_Capture(@TempDir & "\Temposlide.jpg")
$Form1 = GUICreate("The locker.", 615, 104, -1, -1,$WS_POPUP, $WS_EX_TOPMOST)
$1 = GUICtrlCreateSlider(0, 0, 612, 31, $GUI_SS_DEFAULT_SLIDER)
GUICtrlSetCursor (-1, 0)
$2 = GUICtrlCreateSlider(0, 35, 612, 31, $GUI_SS_DEFAULT_SLIDER)
GUICtrlSetCursor (-1, 0)
$3 = GUICtrlCreateSlider(0, 70, 612, 31,$GUI_SS_DEFAULT_SLIDER)
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)
$Pic = GUICreate("TheLocker2",$SW,$SH,0,0,$WS_POPUP,$WS_EX_TOPMOST)
GUICtrlCreatePic(@Tempdir & "\TempoSlide.jpg", 0 , 0 , $SW, $SH)
GUISetState(@SW_SHOW)
WinActivate ($Form1)
While 1
   $Msg = GUIGetMsg()
	  Select
		 Case $Msg =  $GUI_EVENT_CLOSE
			ExitLoop
		 EndSelect
	  If _Ispressed ("11") And _IsPressed ("12") And _IsPressed ("2E")  Then
		 _Taskkill()
	  EndIf
	  If _Ispressed ("12") Then
		 Send ("{ALT}")
	  EndIf
	  _KeyPass()
WEnd

Func _KeyPass()
If _IsPressed ("0D") Then
   $4 = GUICtrlRead ($1)
   $5 = GUICtrlRead ($2) 
   $6 = GUICtrlRead ($3)
   $Combo = $4 & $5 & $6
   If $Combo = "1002070" Then	  
	  WinSetOnTop ($Form1,"",0)
	  WinSetOnTop ($Pic,"",0)
	  Sleep (500)
	  MsgBox(64,"Info","Combination is right , good continuing. .",1.5)
	  Exit
	  Else
	  WinSetOnTop ($Form1,"",0)
	  WinSetOnTop ($Pic,"",0)
	  Sleep (500)
	  MsgBox(64,"Info","Combination wrong, retry.",1.5)
	  WinSetOnTop ($Form1,"",1)
	  WinSetOnTop ($Pic,"",1)
   EndIf
Endif	 
EndFunc
Func _Taskkill()
   ProcessWait ("taskmgr.exe")
   Sleep(500)
   ProcessClose("taskmgr.exe")
EndFunc
I know i could do it in a faster and easyer way , i just figured it now that i'm posting it.
08/26/2013 12:46 CantShutMyMouth#2
Good ideea for a script like this. ! Good Job. Btw, i improoved the security a little bit:



Now , if you have win vista/ 7 , the func taskKill wont work, so i check for task manager in the loop.

The Pic Gui si Locked, so using ALT+TAB will let it up on the screen. But the slider goes down. locking it will make it unuseable, so in the loop i check if the Active Win is Pic, and then , if yes, i activate the Form1 window.

And i hided the TrayIcon, so if you ALT+TAB to desktop, you won't be able to pause the script

I tried to block ALT+F4 also, but didn't work, i tried to BlockInput for 3 seconds if the ALT is pressed, but it doesn't work, dont know why.



Thanks for the script, good work.
08/26/2013 13:12 kimboy600#3
Quote:
Originally Posted by CantShutMyMouth View Post
Good ideea for a script like this. ! Good Job. Btw, i improoved the security a little bit:



Now , if you have win vista/ 7 , the func taskKill wont work, so i check for task manager in the loop.

The Pic Gui si Locked, so using ALT+TAB will let it up on the screen. But the slider goes down. locking it will make it unuseable, so in the loop i check if the Active Win is Pic, and then , if yes, i activate the Form1 window.

And i hided the TrayIcon, so if you ALT+TAB to desktop, you won't be able to pause the script

I tried to block ALT+F4 also, but didn't work, i tried to BlockInput for 3 seconds if the ALT is pressed, but it doesn't work, dont know why.



Thanks for the script, good work.
This was my testing script , in the compiled version there wasn't the TrayIcon.