Jump to content

Password Dialog


Jussip
 Share

Recommended Posts

Hey, im new at autoit, and i need bit help.

How i can set a password, if you type it wrong, it send msg like "Wrong password",

and if i type it right it sends "Right Password"?

This is the script:

#include <GUIConstants.au3>

$Form1 = GUICreate("Enter Password", 283, 112, -1, -1)

GUISetIcon("D:\008.ico")

$PasswordEdit = GUICtrlCreateInput("password", 9, 34, 251, 22, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))

$ButtonOk = GUICtrlCreateButton("&OK", 93, 69, 80, 27, 0)

$ButtonCancel = GUICtrlCreateButton("&Cancel", 180, 69, 81, 27, 0)

$EnterPassLabel = GUICtrlCreateLabel("Enter password ", 9, 13, 93, 18, BitOR($SS_CENTERIMAGE,$SS_RIGHTJUST))

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Link to comment
Share on other sites

Hey, im new at autoit, and i need bit help.

How i can set a password, if you type it wrong, it send msg like "Wrong password",

and if i type it right it sends "Right Password"?

This is the script:

#include <GUIConstants.au3>

$Form1 = GUICreate("Enter Password", 283, 112, -1, -1)

GUISetIcon("D:\008.ico")

$PasswordEdit = GUICtrlCreateInput("password", 9, 34, 251, 22, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))

$ButtonOk = GUICtrlCreateButton("&OK", 93, 69, 80, 27, 0)

$ButtonCancel = GUICtrlCreateButton("&Cancel", 180, 69, 81, 27, 0)

$EnterPassLabel = GUICtrlCreateLabel("Enter password ", 9, 13, 93, 18, BitOR($SS_CENTERIMAGE,$SS_RIGHTJUST))

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Try this:

#include <GUIConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Enter Password", 283, 112, -1, -1)
$PasswordEdit = GUICtrlCreateInput("password", 9, 34, 251, 22, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))
$ButtonOk = GUICtrlCreateButton("&OK", 93, 69, 80, 27, 0)
$ButtonCancel = GUICtrlCreateButton("&Cancel", 180, 69, 81, 27, 0)
$EnterPassLabel = GUICtrlCreateLabel("Enter password ", 9, 13, 93, 18, BitOR($SS_CENTERIMAGE,$SS_RIGHTJUST))
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $ButtonOk
        If GUICtrlRead($PasswordEdit) = "password" Then
            MsgBox(0,"","Correct password")
        Else
            MsgBox(0,"","Wrong password")
            Exit
        EndIf
    Case $ButtonCancel
        Exit
    Case $GUI_EVENT_CLOSE
        Exit
EndSwitch
WEnd

When the words fail... music speaks.

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