Jump to content

Desktop Locker


sak
 Share

Recommended Posts

If you do not want anyone to interfere with your Comp. You must use this program. :)

#NoTrayIcon
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ScrollBarConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#Include <GuiEdit.au3>
#include <Misc.au3>

While 1
    $code = InputBox("Desktop Locker", "Safety. Please reset your password."&@CRLF&@CRLF&"Enter:New Password", Default, "", 250, 143, 370, 300)
    If @error Then
    Exit
    ElseIf $code = '' Then
        ToolTip("Please enter your password in the spaces.", 370, 300, "Desktop Locker", 1, 0)
        Sleep(3000)
        ToolTip("")
    Else
        $plate = StringReplace($code, "|", @CRLF)
        $Password = $plate
        ExitLoop
    EndIf
WEnd

$btn = MsgBox(36, "Desktop Locker", "You want to lock the screen with this code for?.")
If $btn = 6 Then
$Locked = GUICreate("Desktop Locker", @DesktopWidth+3, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBKColor(0x000000, $Locked)

$Progress1 = GUICtrlCreateProgress(440, 415, 150, 10)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

GUICtrlCreatePic("lock.gif", 430, 130, 164, 144)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

$WrongPw = GUICtrlCreateEdit("", 10, 14, 300, @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("Desktop Locker", @DesktopWidth/2-125, @DesktopHeight/2-95, 260, 50, $ES_CENTER, 0)
GUICtrlSetFont(-1, 30, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)

GUICtrlCreateLabel("Please enter a password to unlock the screen.", @DesktopWidth/2-185, @DesktopHeight/2-50, 400, 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)

WinSetState("[CLASS:Shell_TrayWnd]","", @SW_HIDE)
GUISetState(@SW_SHOW, $Locked)
_MouseTrap(@DesktopWidth,@DesktopHeight)

While 1
    If _IsPressed("0D") Then
        If GUICtrlRead($InputPw) == '' Then
            ToolTip("Forgot your password. Please enter the correct", 509, 375, "", 1, 3)
            Sleep(3000)
            ToolTip("")
        ElseIf GUICtrlRead($InputPw) == $Password Then
            For $i = 0 To 100 Step 10
                GUICtrlSetData($Progress1, $i)
                Sleep(100)
            Next
            Sleep(800)
            GUICtrlSetData($Progress1, 100)
            GUISetState(@SW_HIDE, $Locked)
            WinSetState("[CLASS:Shell_TrayWnd]","", @SW_SHOW)
            _MouseTrap()
            GUICtrlSetData($WrongPw, "")
            GUICtrlSetData($InputPw, "")
            ExitLoop
        Else
            GUICtrlSetData($WrongPw, _RandomMsg() & @CRLF & GUICtrlRead($WrongPw))
            ToolTip("The password is incorrect ..try again.", 509, 375, "", 3, 3)
            Sleep(2000)
            ToolTip("")
            GUICtrlSetData($InputPw, "")
        EndIf
    EndIf
    If Not WinActive("Desktop Locker") Then
        WinActivate("Desktop Locker")
        _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
Wend
Else
    Exit
EndIf

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
Link to comment
Share on other sites

Nice program in the list of screen locks :) .

But when the screen is locked, I still see a small strip of my wallpaper: just modify this code:

$Locked = GUICreate("Desktop Locker", @DesktopWidth+3, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)

;Should be:
$Locked = GUICreate("Desktop Locker", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)

And it would be nice if the progress bar is a bit higher on the screen, because the label overlaps the progress and vice-versa. Just modify the progress code:

$Progress1 = GUICtrlCreateProgress((@DesktopWidth - 400) /2, @DesktopHeight/2 + 20, 400, 10)

Now it's a bit bigger and it doesn't overlap the label or whatever on my 1280x1024px screen.

Another remark: why would you set the data of the input and wrong password label to nothing if the program is just gonna closed??? And why would you set the data of the progress to 100 if it's already 100???

I don't want to nag a lot, but you just have useless functions used and you could make your code shorter :)

P.S. I ran Tidy on it because it was not so clear for me.

Code after I modified it:

#NoTrayIcon
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ScrollBarConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <GuiEdit.au3>
#include <Misc.au3>

While 1
    $code = InputBox("Desktop Locker", "Safety. Please reset your password." & @CRLF & @CRLF & "Enter:New Password", Default, "", 250, 143, 370, 300)
    If @error Then
        Exit
    ElseIf $code = '' Then
        ToolTip("Please enter your password in the spaces.", 370, 300, "Desktop Locker", 1, 0)
        Sleep(3000)
        ToolTip("")
    Else
        $plate = StringReplace($code, "|", @CRLF)
        $Password = $plate
        ExitLoop
    EndIf
WEnd

$btn = MsgBox(36, "Desktop Locker", "You want to lock the screen with this code (" & $Password & ")? ")
If $btn = 6 Then
    $Locked = GUICreate("Desktop Locker", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000, $Locked)

    $Progress1 = GUICtrlCreateProgress((@DesktopWidth - 400) / 2, @DesktopHeight / 2 + 20, 400, 10)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

    GUICtrlCreatePic("lock.gif", 430, 130, 164, 144)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

    $WrongPw = GUICtrlCreateEdit("", 10, 14, 300, @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("Desktop Locker", @DesktopWidth / 2 - 125, @DesktopHeight / 2 - 95, 260, 50, $ES_CENTER, 0)
    GUICtrlSetFont(-1, 30, 800, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetBkColor(-1, 0x000000)

    GUICtrlCreateLabel("Please enter a password to unlock the screen.", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 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)

    WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_HIDE)
    GUISetState(@SW_SHOW, $Locked)
    _MouseTrap(@DesktopWidth, @DesktopHeight)

    While 1
        If _IsPressed("0D") Then
            If GUICtrlRead($InputPw) == '' Then
                ToolTip("Forgot your password. Please enter the correct", 509, 375, "", 1, 3)
                ToolTip("")
            ElseIf GUICtrlRead($InputPw) == $Password Then
                For $i = 0 To 100 Step 10
                    GUICtrlSetData($Progress1, $i)
                    Sleep(50)
                Next
                GUISetState(@SW_HIDE, $Locked)
                WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_SHOW)
                _MouseTrap()
                ExitLoop
            Else
                GUICtrlSetData($WrongPw, _RandomMsg() & @CRLF & GUICtrlRead($WrongPw))
                ToolTip("The password is incorrect ..try again.", 509, 375, "", 3, 3)
                Sleep(2000)
                ToolTip("")
                GUICtrlSetData($InputPw, "")
            EndIf
        EndIf
        If Not WinActive("Desktop Locker") Then
            WinActivate("Desktop Locker")
            _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
    WEnd
Else
    Exit
EndIf

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   ;==>_RandomMsg
PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.
Link to comment
Share on other sites

Hello,

I´m new at Autoit (and new at programming), and i´m working on a script that has nothing to do with computer lock. But I want to do something that this Desktop Locker does: avoid people to stop the script (disable access to the task manager).

When running the Desktop Locker, if I hit CTRL-ALT-DEL and click Task Manager, the Task Manager windows appears, but the Desktop Locker screen soon goes over it, making it impossible to stop any task.

Could any one show me the part of the script that makes it? I´d like to put it in my script.

Thank you all.

Edited by programer
Link to comment
Share on other sites

Probably best to have a look at the Help File and learn about GUI creation.

UDF List:

 
_AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Hey New To This But This Desktop Locker Is Great ! But I Spotted A Few Errors So I Clean It Up Abit Now Try It :)

#NoTrayIcon
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ScrollBarConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <GuiEdit.au3>
#include <Misc.au3>

While 1
    $code = InputBox("Desktop Locker", "Safety. Please Reset Your Password." & @CRLF & @CRLF & "Enter: New Password", Default, "", 350, 150, 200, 400)
    If @error Then
        Exit
    ElseIf $code = '' Then
        ToolTip("Please Enter Your Password In The Spaces.", 370, 300, "Desktop Locker", 1, 0)
        Sleep(3000)
        ToolTip("")
    Else
        $plate = StringReplace($code, "|", @CRLF)
        $Password = $plate
        ExitLoop
    EndIf
WEnd

$btn = MsgBox(36, "Desktop Locker", "You Want To Lock The Screen With This Code (" & $Password & ")? ")
If $btn = 6 Then
    $Locked = GUICreate("Desktop Locker", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000, $Locked)

    $Progress1 = GUICtrlCreateProgress((@DesktopWidth - 400) / 2, @DesktopHeight / 2 + 20, 400, 10)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

    GUICtrlCreatePic("lock.gif", 430, 130, 164, 144)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

    $WrongPw = GUICtrlCreateEdit("", 10, 14, 300, @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("Desktop Locker", @DesktopWidth / 2 - 125, @DesktopHeight / 2 - 95, 260, 50, $ES_CENTER, 0)
    GUICtrlSetFont(-1, 30, 800, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetBkColor(-1, 0x000000)

    GUICtrlCreateLabel("Please Enter A Password To Unlock The Screen.", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 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)

    WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_HIDE)
    GUISetState(@SW_SHOW, $Locked)
    _MouseTrap(@DesktopWidth, @DesktopHeight)

    While 1
        If _IsPressed("0D") Then
            If GUICtrlRead($InputPw) == $Password Then
               GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Correct Password ! Unlocking...", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0x66FF00)
                For $i = 1 To 100 Step 2
                    GUICtrlSetData($Progress1, $i)
                    Sleep(50)
                Next
               GUISetState(@SW_HIDE, $Locked)
               WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_SHOW)
                _MouseTrap()
                GUICtrlSetData($InputPw, "")
                ExitLoop
            Else
            GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Incorrect Password ! Please Try Again...", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0xFF0000)
            GUICtrlSetData($InputPw, "")
            EndIf
        EndIf
        If Not WinActive("Desktop Locker") Then
            GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Trying To Hack This? :(", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0xFF0000)
            GUICtrlSetData($InputPw, "")
            WinActivate("Desktop Locker")
            _MouseTrap(@DesktopWidth, @DesktopHeight)
        EndIf
    WEnd
Else
    Exit
EndIf

FeedBack Would Be Great :)

Edited by Gedzy
Link to comment
Share on other sites

Gedzy,

Works good, but one remark: Why do you use in the For loop for 'unlocking' Step 2???

And if you also have Sleep(50), you get 50*50 = 2500 ms = 2,5 seconds for 'unlocking'.

That's way too long I think...

PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.
Link to comment
Share on other sites

Gedzy,

Works good, but one remark: Why do you use in the For loop for 'unlocking' Step 2???

And if you also have Sleep(50), you get 50*50 = 2500 ms = 2,5 seconds for 'unlocking'.

That's way too long I think...

Hey There :) well It's to display the text when the password is correct and yeah your right I just like looking at loader load up. I'm also looking for a stronger way for the program to lock the screen I.E. the user may use Ctrl + Alt + Del or Logoff /Try something else - which may cause the program to stop:

WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_HIDE)
    GUISetState(@SW_SHOW, $Locked)
    _MouseTrap(@DesktopWidth, @DesktopHeight)

If Not WinActive("Desktop Locker") Then

;other code

GUICtrlSetData($InputPw, "")
            WinActivate("Desktop Locker")
            _MouseTrap(@DesktopWidth, @DesktopHeight)

Any help? Thanks Gedzy :)

Link to comment
Share on other sites

yorba,

How do you mean to make it tranparent?? If you mean what I think, you have to use WinSetTrans($Locked, "", [transparency you want to have from 0-255, by example 240]) before GUISetState(@SW_SHOW, $Locked). :)

PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.
Link to comment
Share on other sites

Guest yorba

yorba,

How do you mean to make it tranparent?? If you mean what I think, you have to use WinSetTrans($Locked, "", [transparency you want to have from 0-255, by example 240]) before GUISetState(@SW_SHOW, $Locked). :)

Ok, will this remove the black background on the lock screen so that I can see my desktop? Sorry if my English is bad.

Edit: It didn't work. Did I do it wrong?

WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_HIDE)
    WinSetTrans("Shell_TrayWnd", "", 10)
    GUISetState(@SW_SHOW, $Locked)
    _MouseTrap(@DesktopWidth, @DesktopHeight)
Edited by yorba
Link to comment
Share on other sites

Hey Back Again :) Urm Ive added more to the Desktop Locker:

1) System Information Shows

2) Transparency Set Thank to " "

3) Improve Security Can only be closed on Log-off or Closed Remotely

Code:

#NoTrayIcon
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ScrollBarConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <GuiEdit.au3>
#include <Misc.au3>
#include <WinAPI.au3>
$var0 = String(@ComputerName)
$var1 = String(@LogonServer)
$var2 = String(@OSVersion)
$var3 = String(@HomeDrive & "\")
$var4 = String(@HomeShare)
IF $var4 = "" Then
    $var4 = String("No HomeShare Exist")
Else
    $var4 = String(@HomeShare)
EndIF
$var5 = String(@IPAddress1)
$var6 = String(@LogonDomain)
$var7 = String(@LogonServer)
$var8 = string(@OSServicePack)
IF $var8 = "" Then
    $var8 = String("No OSServicePack Found")
Else
    $var8 = string(@OSServicePack)
Endif
$var9 = String(@UserName & "," & " " & "Based @" & " " & @UserProfileDir)
While 1
      $code =  InputBox("Desktop Locker", "Computer Information:" & @CRLF & @CRLF & "Logon Server: " & $var1 & @CRLF & "OSVersion: " & $var2 & @CRLF & "Home Drive: " & $var3 & @CRLF  & "Home Share: " & $var4 &@CRLF & "IP Address: " & $var5 & @CRLF & "Logon Domain: " & $var6 & @CRLF & "Logon Sever: " & $var7 & @CRLF & "Server Pack: " & $var8 & @CRLF & "Username: " & $var9 & @CRLF & @CRLF & "Safety. Please Reset Your Password." & @CRLF & @CRLF & "Enter: New Password For " & $var0, Default, "*", 300, 300, 300, 300, 60)
    If @error Then
        Exit
    ElseIf $code = '' Then
        ToolTip("Please Enter Your Password In The Spaces.", 370, 300, "Desktop Locker", 1, 0, BitOR($ES_CENTER, $ES_PASSWORD), "", "*")
    Else
        $plate = StringReplace($code, "*", @CRLF)
        $Password = $plate
        ExitLoop
    EndIf
WEnd
$btn = 0
If $btn = 0 Then
    $Locked = GUICreate("Desktop Locker", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000, $Locked)
    $Progress1 = GUICtrlCreateProgress((@DesktopWidth - 400) / 2, @DesktopHeight / 2 + 20, 400, 10)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlCreatePic("lock.gif", 430, 130, 164, 144)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    $WrongPw = GUICtrlCreateEdit("", 10, 14, 300, @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("Desktop Locker", @DesktopWidth / 2 - 125, @DesktopHeight / 2 - 95, 260, 50, $ES_CENTER, 0)
    GUICtrlSetFont(-1, 30, 800, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Please Enter A Password To Unlock The Screen.", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 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)
    WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_HIDE)
    WinSetTrans($Locked, "", 230) 
    GUISetState(@SW_SHOW, $Locked)
    _MouseTrap(@DesktopWidth, @DesktopHeight)
    While 1
        If _IsPressed("0D") Then
            If GUICtrlRead($InputPw) == $Password Then
               GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Correct Password ! Unlocking...", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0x66FF00)
                For $i = 1 To 100 Step 10
                    GUICtrlSetData($Progress1, $i)
                    Sleep(50)
                Next
               GUISetState(@SW_HIDE, $Locked)
               WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_SHOW)
                _MouseTrap()
                GUICtrlSetData($InputPw, "")
                ExitLoop
            Else
            GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Incorrect Password ! Please Try Again...", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0xFF0000)
            GUICtrlSetData($InputPw, "")
            EndIf
        EndIf
        If Not WinActive("Desktop Locker") Then
            GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Trying To Hack This? :(", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0xFF0000)
            GUICtrlSetData($InputPw, "")
            WinActivate("Desktop Locker")
            _MouseTrap(@DesktopWidth, @DesktopHeight)
        EndIf
        If ProcessExists("Taskmgr.exe") Then
            ProcessClose("Taskmgr.exe") 
        Endif
    WEnd
Else
    Exit
EndIf

Any Feed Back Or Improvement? Thanks Gedzy :P:)

Link to comment
Share on other sites

Hey Back Again :) Urm Ive added more to the Desktop Locker:

1) System Information Shows

2) Transparency Set Thank to " "

3) Improve Security Can only be closed on Log-off or Closed Remotely

Code:

#NoTrayIcon
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ScrollBarConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <GuiEdit.au3>
#include <Misc.au3>
#include <WinAPI.au3>
$var0 = String(@ComputerName)
$var1 = String(@LogonServer)
$var2 = String(@OSVersion)
$var3 = String(@HomeDrive & "\")
$var4 = String(@HomeShare)
IF $var4 = "" Then
    $var4 = String("No HomeShare Exist")
Else
    $var4 = String(@HomeShare)
EndIF
$var5 = String(@IPAddress1)
$var6 = String(@LogonDomain)
$var7 = String(@LogonServer)
$var8 = string(@OSServicePack)
IF $var8 = "" Then
    $var8 = String("No OSServicePack Found")
Else
    $var8 = string(@OSServicePack)
Endif
$var9 = String(@UserName & "," & " " & "Based @" & " " & @UserProfileDir)
While 1
      $code =  InputBox("Desktop Locker", "Computer Information:" & @CRLF & @CRLF & "Logon Server: " & $var1 & @CRLF & "OSVersion: " & $var2 & @CRLF & "Home Drive: " & $var3 & @CRLF  & "Home Share: " & $var4 &@CRLF & "IP Address: " & $var5 & @CRLF & "Logon Domain: " & $var6 & @CRLF & "Logon Sever: " & $var7 & @CRLF & "Server Pack: " & $var8 & @CRLF & "Username: " & $var9 & @CRLF & @CRLF & "Safety. Please Reset Your Password." & @CRLF & @CRLF & "Enter: New Password For " & $var0, Default, "*", 300, 300, 300, 300, 60)
    If @error Then
        Exit
    ElseIf $code = '' Then
        ToolTip("Please Enter Your Password In The Spaces.", 370, 300, "Desktop Locker", 1, 0, BitOR($ES_CENTER, $ES_PASSWORD), "", "*")
    Else
        $plate = StringReplace($code, "*", @CRLF)
        $Password = $plate
        ExitLoop
    EndIf
WEnd
$btn = 0
If $btn = 0 Then
    $Locked = GUICreate("Desktop Locker", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000, $Locked)
    $Progress1 = GUICtrlCreateProgress((@DesktopWidth - 400) / 2, @DesktopHeight / 2 + 20, 400, 10)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlCreatePic("lock.gif", 430, 130, 164, 144)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    $WrongPw = GUICtrlCreateEdit("", 10, 14, 300, @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("Desktop Locker", @DesktopWidth / 2 - 125, @DesktopHeight / 2 - 95, 260, 50, $ES_CENTER, 0)
    GUICtrlSetFont(-1, 30, 800, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Please Enter A Password To Unlock The Screen.", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 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)
    WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_HIDE)
    WinSetTrans($Locked, "", 230) 
    GUISetState(@SW_SHOW, $Locked)
    _MouseTrap(@DesktopWidth, @DesktopHeight)
    While 1
        If _IsPressed("0D") Then
            If GUICtrlRead($InputPw) == $Password Then
               GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Correct Password ! Unlocking...", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0x66FF00)
                For $i = 1 To 100 Step 10
                    GUICtrlSetData($Progress1, $i)
                    Sleep(50)
                Next
               GUISetState(@SW_HIDE, $Locked)
               WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_SHOW)
                _MouseTrap()
                GUICtrlSetData($InputPw, "")
                ExitLoop
            Else
            GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Incorrect Password ! Please Try Again...", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0xFF0000)
            GUICtrlSetData($InputPw, "")
            EndIf
        EndIf
        If Not WinActive("Desktop Locker") Then
            GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Trying To Hack This? :(", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0xFF0000)
            GUICtrlSetData($InputPw, "")
            WinActivate("Desktop Locker")
            _MouseTrap(@DesktopWidth, @DesktopHeight)
        EndIf
        If ProcessExists("Taskmgr.exe") Then
            ProcessClose("Taskmgr.exe") 
        Endif
    WEnd
Else
    Exit
EndIf

Any Feed Back Or Improvement? Thanks Gedzy :P:)

Link to comment
Share on other sites

Hey Back Again :) Urm Ive added more to the Desktop Locker:

1) System Information Shows

2) Transparency Set Thank to AppTux

3) Improve Security Can only be closed on Log-off or Closed Remotely

Code:

#NoTrayIcon
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ScrollBarConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <GuiEdit.au3>
#include <Misc.au3>
#include <WinAPI.au3>
$var0 = String(@ComputerName)
$var1 = String(@LogonServer)
$var2 = String(@OSVersion)
$var3 = String(@HomeDrive & "\")
$var4 = String(@HomeShare)
IF $var4 = "" Then
    $var4 = String("No HomeShare Exist")
Else
    $var4 = String(@HomeShare)
EndIF
$var5 = String(@IPAddress1)
$var6 = String(@LogonDomain)
$var7 = String(@LogonServer)
$var8 = string(@OSServicePack)
IF $var8 = "" Then
    $var8 = String("No OSServicePack Found")
Else
    $var8 = string(@OSServicePack)
Endif
$var9 = String(@UserName & "," & " " & "Based @" & " " & @UserProfileDir)
While 1
      $code =  InputBox("Desktop Locker", "Computer Information:" & @CRLF & @CRLF & "Logon Server: " & $var1 & @CRLF & "OSVersion: " & $var2 & @CRLF & "Home Drive: " & $var3 & @CRLF  & "Home Share: " & $var4 &@CRLF & "IP Address: " & $var5 & @CRLF & "Logon Domain: " & $var6 & @CRLF & "Logon Sever: " & $var7 & @CRLF & "Server Pack: " & $var8 & @CRLF & "Username: " & $var9 & @CRLF & @CRLF & "Safety. Please Reset Your Password." & @CRLF & @CRLF & "Enter: New Password For " & $var0, Default, "*", 300, 300, 300, 300, 60)
    If @error Then
        Exit
    ElseIf $code = '' Then
        ToolTip("Please Enter Your Password In The Spaces.")
    Else
        $plate = StringReplace($code, "*", @CRLF)
        $Password = $plate
        ExitLoop
    EndIf
WEnd
$btn = 0
If $btn = 0 Then
    $Locked = GUICreate("Desktop Locker", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000, $Locked)
    $Progress1 = GUICtrlCreateProgress((@DesktopWidth - 400) / 2, @DesktopHeight / 2 + 20, 400, 10)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlCreatePic("lock.gif", 430, 130, 164, 144)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    $WrongPw = GUICtrlCreateEdit("", 10, 14, 300, @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("Desktop Locker", @DesktopWidth / 2 - 125, @DesktopHeight / 2 - 95, 260, 50, $ES_CENTER, 0)
    GUICtrlSetFont(-1, 30, 800, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlCreateLabel("Please Enter A Password To Unlock The Screen.", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 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)
    WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_HIDE)
    WinSetTrans($Locked, "", 240) 
    GUISetState(@SW_SHOW, $Locked)
    _MouseTrap(@DesktopWidth, @DesktopHeight)
    While 1
        If _IsPressed("0D") Then
            If GUICtrlRead($InputPw) == $Password Then
               GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Correct Password ! Unlocking...", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0x66FF00)
                For $i = 1 To 100 Step 10
                    GUICtrlSetData($Progress1, $i)
                    Sleep(50)
                Next
               GUISetState(@SW_HIDE, $Locked)
               WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_SHOW)
                _MouseTrap()
                GUICtrlSetData($InputPw, "")
                ExitLoop
            Else
            GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Incorrect Password ! Please Try Again...", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0xFF0000)
            GUICtrlSetData($InputPw, "")
            EndIf
        EndIf
        If Not WinActive("Desktop Locker") Then
            GUICtrlSetData($InputPw, "")
               GUICtrlCreateLabel("Trying To Hack This? :(", @DesktopWidth / 2 - 185, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
               GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
               GUICtrlSetColor(-1, 0xFF0000)
            GUICtrlSetData($InputPw, "")
            WinActivate("Desktop Locker")
            _MouseTrap(@DesktopWidth, @DesktopHeight)
        EndIf
        If ProcessExists("Taskmgr.exe") Then
            ProcessClose("Taskmgr.exe") 
        Endif
    WEnd
Else
    Exit
EndIf

Any Feed Back Or Improvement? Thanks Gedzy :P:)

Edited by Gedzy
Link to comment
Share on other sites

Gedzy,

Don't you have a Edit button in the right-bottom corner of your post? It's really, really pretty horribly annoying if you post almost the same post but with a bit difference. I don't know how much posts you need to have before you can edit and remove posts... I forgot that. :)

PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.
Link to comment
Share on other sites

@Gedzy : lines 37 of your script don't work. Make sure it works before posting it.

ToolTip("Please Enter Your Password In The Spaces.", 370, 300, "Desktop Locker", 1, 0, BitOR($ES_CENTER, $ES_PASSWORD), "", "*")
for
ToolTip("Please Enter Your Password In The Spaces.", Default, Default , "Desktop Locker", 1, 0)
Nice script btw Posted Image Edited by Jayson
Link to comment
Share on other sites

@Gedzy : lines 37 of your script don't work. Make sure it works before posting it.

ToolTip("Please Enter Your Password In The Spaces.", 370, 300, "Desktop Locker", 1, 0, BitOR($ES_CENTER, $ES_PASSWORD), "", "*")
for
ToolTip("Please Enter Your Password In The Spaces.)
Nice script btw Posted Image

Cool Man Thanks For That

Link to comment
Share on other sites

Gedzy,

I would recommend to make the window a bit less transparent: Something like a transparency of 240.

PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.
Link to comment
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
 Share

  • Recently Browsing   0 members

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