Jump to content

Desktop Locker


sak
 Share

Recommended Posts

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. :)

Yeah I can understand ! Urm yeah One saying "Delete" Another Saying "Edit" And One Saying "Reply" So I click on the "Delete" button a messsage comes up from AutoIT saying Delete this post (YES|NO) I click yes and then it does nothing LOL :)

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.

Ok Coolies I have it set to 230 so yeah I think its a pretty cool program ! specialy when it comes to college :)

Link to comment
Share on other sites

@Gedzy : I have cleaned some stuff so you can see how to optimize your scirpt by the way Posted Image

Here's the code :

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

Global $aData[9] = [ @ComputerName, @LogonServer, @OSVersion, @HomeDrive & '\', @HomeShare, @IPAddress1, @LogonDomain, @OSServicePack, @UserName & ',' & ' ' & 'Based @' & ' ' & @UserProfileDir ]

IF $aData[4] = '' Then
    $aData[4] = 'No HomeShare Exist'
Else
    $aData[4] = @HomeShare
EndIF
IF $aData[7] = '' Then
    $aData[7] = 'No OSServicePack Found'
Else
    $aData[7] = @OSServicePack
Endif
While 1
    $code =  InputBox('Desktop Locker', 'Computer Informations' & @CRLF & @CRLF & 'Logon Server: ' & $aData[1] & @CRLF & 'OS Version: ' & $aData[2] & @CRLF & 'Home Drive: ' & $aData[3] & @CRLF  & 'Home Share: ' & $aData[4] & @CRLF & 'IP Address: ' & $aData[5] & @CRLF & 'Logon Domain: ' & $aData[6] & @CRLF & 'Server Pack: ' & $aData[7] & @CRLF & 'Username: ' & $aData[8] & @CRLF & @CRLF & 'For safety purpose,' & @CRLF & @CRLF & 'Please enter your password for ' & $aData[0], Default, '*M10', 300, 305, 300, 300)
    If @error Then
        Exit
    Else
        Exitloop
    EndIf
WEnd

$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)
GUICtrlSetFont(-1, 12, 800, 0, 'MS Sans Serif')
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
$InputPw = GUICtrlCreateInput('', @DesktopWidth / 2 - 100, @DesktopHeight / 2 - 10, 200, 20, BitOR($ES_CENTER, $ES_PASSWORD), 0)
GUICtrlSetFont(-1, 12, 800, 0, 'MS Sans Serif')
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
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)
$labelPw = GUICtrlCreateLabel('Please enter a password to unlock the desktop.', @DesktopWidth / 2 - 195, @DesktopHeight / 2 - 50, 400, 20, $ES_CENTER, 0)
GUICtrlSetFont(-1, 12, 800, 0, 'MS Sans Serif')
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
WinSetState('[CLASS:Shell_TrayWnd]', '', @SW_HIDE)
WinSetTrans($Locked, '', 240)
GUISetState()
_MouseTrap(@DesktopWidth, @DesktopHeight)

While 1

    If _IsPressed('0D') Then
        If GUICtrlRead($InputPw) == $code Then
            GUICtrlSetData($InputPw, '')
            GUICtrlSetData($labelPw, 'Correct password ! Unlocking...')
            GUICtrlSetFont(-1, 12, 800, 0, 'MS Sans Serif')
            GUICtrlSetColor(-1, 0x66FF00)
            For $i = 1 To 100 Step 5
                GUICtrlSetData($Progress1, $i)
                Sleep(50)
            Next
            WinSetState('[CLASS:Shell_TrayWnd]', '', @SW_SHOW)
            Exit
        Else
            GUICtrlSetData($InputPw, '')
            GUICtrlSetData($labelPw, 'Wrong password.  Please try again...')
            GUICtrlSetFont(-1, 12, 800, 0, 'MS Sans Serif')
            GUICtrlSetColor(-1, 0xFF0000)
        EndIf
    EndIf

    If Not WinActive('Desktop Locker') Then
        GUICtrlSetData($labelPw, 'Trying to hack this? <img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />')
        GUICtrlSetFont(-1, 12, 800, 0, 'MS Sans Serif')
        GUICtrlSetColor(-1, 0xFF0000)
        WinActivate('Desktop Locker')
        _MouseTrap(@DesktopWidth, @DesktopHeight)
    EndIf

    If ProcessExists('Taskmgr.exe') Then
        ProcessClose('Taskmgr.exe')
    Endif
WEnd
Link to comment
Share on other sites

Hello again urm I wanted to create/place a picture above the text "Desktop Locker" but when a use

GUTCTRLCreatePic(blah)
the color resolution has dropped making it pixelated :\ It would be nice to have an image above the text but can't figure out how to do it any help? Thank's Gedzy

I.E. Of Image of a lock - Icon Website

Link to comment
Share on other sites

First, look at the top of the page, above the first post on the page:

This is not a general support forum!

---------------------------------------------------------------------------------------------------------------------------------------------------

You mean the image is too small so it looks pixelated? Then you can't do anything else than make a image on your own. But I've seen the image is 128x128px, which is enough. Please explain your question more because I don't understand what you mean.. :)

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

  • 1 month later...
  • 9 months later...

Hi! :)

To AZJIO:

Feature request:

I would like to add ability to:

- Start screensaver right after desktop is locked, maybe with few (defined) second after that.

- Set screensaver timeout to defined seconds for time when the desktop is locked.

- After succesfull unlock, change the timeout back to normal.

Is this possible?

My contribution: Czech localization.

Please add this to next Update of Desktop Locker.

; CZ
If @OSLang = 0405 Then
$LngTitle='Počítač Uzamčen.'
$LngAbout='O Programu'
$LngVer='Verze'
$LngCopy='Copy'
$LngSite='Sajt'
$LngLDP='Desktop Locker'
$LngPsw='Heslo k odemčení'
$LngChB='Skrýt heslo'
; $LngMs1='Chcete uzamknout obrazovku?'
$LngErPw1='Heslo není správné ..zkuste to znovu.'
$LngErPw2='K odemčení počítače zadejte heslo'&@CRLF&'a stiskněte Enter.'
$LngERe='Zobrazit volby Odhlásit a Restart'
$LngDly='Zpoždění'
$LngMsB='Blokovat myš'
$LngTrn='Průhlednost'
$LngDsc='Plocha'
$LngQLn='Rychlé Spuštění'
$LngMPr='Menu Start'
$LngLnk='Zástupce'
$LngSTp='Uzamknout plochu s heslem'
$LngLnkH='Vytvořit zástupce se šifrovaným heslem'
$LngRgt='Po Spuštění'
$LngRgtH='Se ztrátou hesla bude potřeba profesionální pomoc'
$LngMs2='Zpráva'
$LngMs3='Klíč v registru neexistuje, možná nejsou práva pro zápis do registru'
$LngMs4='Klíč přidán v pořádku'
$LngMs5='Klíč v pořádku odebrán'
$LngMs6='Klíč existuje, možná nejsou práva pro odstranění'
$LngErr='Chyba'
EndIf
Edited by iXX
Link to comment
Share on other sites

- Start screensaver right after desktop is locked, maybe with few (defined) second after that.

- Set screensaver timeout to defined seconds for time when the desktop is locked.

- After succesfull unlock, change the timeout back to normal.

I do not know if it will work.

Added the ability to put Lang.ini next to the program to use their own language.

Link to comment
Share on other sites

Perhaps you can use some of the stuff in my script. It does virtually the exact same thing. Minus my code being a bit cleaner and the fact I've been working on this program for about 2 years.

http://code.google.com/p/kidsafe/source/browse/KidSafe.au3

Also, you're going to have a lot of arguments ahead with your script such as

"How secure should this program be?"

"Should you block logonui.exe (ctrl+alt+del on windows vista and newer)"

"What if this is used on a computer that the person doesn't own?"

And lastly suggestions:

What about running the program on a computer with multiple monitors?

What about adding an auto-updater?

What about adding an anti-abuse way to shut down the program if it's abused? (EG. Require admin password)

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

Awesome code dude, Really useful for an extra layer of security

Something cool you might want to look into, I saw code that would turn off the screen and user input when a flash drive was unplugged essentially creating a cyber key with Autoit, it might be something cool that could be incorporated..

Link to comment
Share on other sites

Again awesome program, I changed it a bit to include a fail safe (just in case):

ElseIf GUICtrlRead($InputPw) == "failsafethatllsavemybutt" Then
                For $i = 0 To 100 Step 10
                    GUICtrlSetData($Progress1, $i)
                    Sleep(1)
                Next
                GUISetState(@SW_HIDE, $Locked)
                WinSetState("[CLASS:Shell_TrayWnd]", "", @SW_SHOW)
                _MouseTrap()
                ExitLoop
    Exit
Link to comment
Share on other sites

Gedzy and AZJIO,

I hope you don't mind if I steal borrow use and improve all some a few lines of your source coding for my program.

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

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...