Jump to content

A Funny Computer Lock


Delta
 Share

Recommended Posts

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]

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 weeks later...
  • 10 months later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...