Sign in to follow this  
Followers 0
Delta

A Funny Computer Lock

10 posts in this topic

I got really bored and came up with this fun little toy. It's not meant to be used as a real PC locker. Try typing in a wrong password or alt tabbing. You don't need lock.gif to make this work I just had it in there as eye candy.

Small note, you may have to hold enter after you type the password.

Opt("TrayMenuMode",1)
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ScrollBarConstants.au3>
#Include <GuiEdit.au3>
#include <Misc.au3>

Local $Password = "password"

$Lock = TrayCreateItem("Lock")
$Locked = GUICreate("1337", @DesktopWidth+3, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBKColor(0x000000, $Locked)
GUICtrlCreatePic("lock.gif", 0, 0,@DesktopWidth,@DesktopHeight)

$WrongPw = GUICtrlCreateEdit("", 4, 14, 400, @DesktopHeight - 14, BitOR($ES_AUTOVSCROLL,$ES_READONLY), 0)
$InputPw = GUICtrlCreateInput("", @DesktopWidth/2-100, @DesktopHeight/2-10, 200, 20, BitOR($ES_CENTER, $ES_PASSWORD), 0)

GUICtrlCreateLabel("::Enter Password::", @DesktopWidth/2-100, @DesktopHeight/2-30, 200, 20, $ES_CENTER, 0)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)

GUICtrlSetFont($WrongPw, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor($WrongPw, 0xFFFFFF)
GUICtrlSetBkColor($WrongPw, 0x000000)
GUICtrlSetFont($InputPw, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor($InputPw, 0xFFFFFF)
GUICtrlSetBkColor($InputPw, 0x000000)
While 1
    If TrayGetMsg() == $Lock Then
        WinSetState("[CLASS:Shell_TrayWnd]","", @SW_HIDE)
        GUISetState(@SW_SHOW, $locked)
        _MouseTrap(@DesktopWidth,@DesktopHeight)
        While 1
            If _IsPressed("0D") Then
                If GUICtrlRead($InputPw) == $Password Then
                    GUISetState(@SW_HIDE, $locked)
                    WinSetState("[CLASS:Shell_TrayWnd]","", @SW_SHOW)
                    _MouseTrap()
                    GUICtrlSetData($WrongPw, "")
                    GUICtrlSetData($InputPw, "")
                    ExitLoop
                Else
                    GUICtrlSetData($WrongPw, _RandomMsg() & @CRLF & GUICtrlRead($WrongPw))
                EndIf
            EndIf
            If Not WinActive("1337") Then 
                WinActivate("1337")
                _MouseTrap(@DesktopWidth,@DesktopHeight)
                GUICtrlCreateLabel("MESS WITH THE BEST DIE LIKE THE REST!", Random(@DesktopWidth-540), Random(@DesktopHeight-30),540,30)
                GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
                GUICtrlSetColor(-1, 0xFF0000)
                GUICtrlSetBkColor(-1, 0x000000)
            EndIf   
            Sleep(100)
        Wend
    EndIf
Wend

Func _RandomMsg()
    Local $RandomMsg[10]
    $RandomMsg[0] = "Wrong Password!"
    $RandomMsg[1] = "Step away from the computer."
    $RandomMsg[2] = "Your not Jim."
    $RandomMsg[3] = "Give Up!"
    $RandomMsg[4] = "Don't Touch!"
    $RandomMsg[5] = "Please Enter Correct Password."
    $RandomMsg[6] = "Try Again!"
    $RandomMsg[7] = "Stop pushing my buttons."
    $RandomMsg[8] = "INS! INS!"
    $RandomMsg[9] = "Ctrl-Alt-Dipshit"
    
    Return $RandomMsg[Random(10)]
EndFunc

[size="1"]Please stop confusing "how to" with "how do"[/size]

Share this post


Link to post
Share on other sites



Not working full scren for me, don't know why... don't care either :D It's pretty cool ;)

Share this post


Link to post
Share on other sites

very nice

i where to stupid to typ in password *password*

Share this post


Link to post
Share on other sites

Global Const $OBJID_CLIENT = 0xFFFFFFFC

Global Const ^ ERROR

can you tell me why is this?

Share this post


Link to post
Share on other sites

Try removing #include <ScrollBarConstants.au3> You don't really need it I just left it in there when I was testing it out.


[size="1"]Please stop confusing "how to" with "how do"[/size]

Share this post


Link to post
Share on other sites

Nice! but can you make one without the TrayIcon. it should open the lock with a mouse click straight away.

Share this post


Link to post
Share on other sites

It works fine...

Anyone found a way to close it without password ? (i want to know if it's a little bit secure)

When i do CTRL-ALT-DEL i can't click any button anyone else have this behavior ?

Share this post


Link to post
Share on other sites

your the bet, exactle what i wanted .. :)

Share this post


Link to post
Share on other sites

That's Good..Its better then others..OmG..You are really intellegent if u made this Script yourself..

Hehe.. >_<

Thanks for you..


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0