Sign in to follow this  
Followers 0
Jussip

Password Dialog

2 posts in this topic

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

Share this post


Link to post
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

#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <windowsconstants.au3>
#include <staticconstants.au3>
#include <editconstants.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
        Case $ButtonOk
            If GUICtrlRead($PasswordEdit) <> "allowedin" Then MsgBox(262144, "Wrong", "password is not correct")
    EndSwitch
WEnd

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
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
Sign in to follow this  
Followers 0