Jump to content

How to make Logon Password


Recommended Posts

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$CorrectPassword = "Password"

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Password Dialog", 468, 319, -1, -1)
GUISetIcon("lock.ico")
$PasswordEdit = GUICtrlCreateInput("", 48, 128, 209, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$ButtonOk = GUICtrlCreateButton("&OK", 14, 240, 67, 25, 0)
$ButtonCancel = GUICtrlCreateButton("&Cancel", 95, 240, 67, 25, 0)
$EnterPassLabel = GUICtrlCreateLabel("Enter password", 8, 12, 77, 17)
$Pic1 = GUICtrlCreatePic("wall.bmp", -25, 0, 492, 316, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE, $ButtonCancel
            Exit
        Case $ButtonOK
            If GuiCtrlRead($PasswordEdit) == $CorrectPassword then; "==" makes it case-sensative
                Msgbox(0,"Access Granted", "Thank you for logging in.")
                ExitLoop
            Else
                MsgBox(0,"Access Denied", "Sorry, The password you entered is incorrect.")
            EndIf
    EndSwitch
WEnd
;Rest of code to do when pass is correct here

Edited by Paulie
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...