Hello Me You Posted February 11, 2007 Posted February 11, 2007 Help me protect the following window with pass. Here is what I want: 1) A small window opens. Asks for password. 2) If password is correct, show the other window. 3) If password is wrong, then a MsgBox says: "Wrong Password" and with buttons (Retry & Cancel). Here is my main window witch I want to protect: #include <GuiConstants.au3> GuiCreate("Enter Text To Notepad", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Label_info = GuiCtrlCreateLabel("Enter text below:", 50, 20, 280, 20) $Input_text = GuiCtrlCreateInput("text", 50, 100, 290, 20) $Button_ok = GuiCtrlCreateButton("Button3", 50, 210, 290, 40) $Label_ok = GuiCtrlCreateLabel("Click ok button to send text to notepad", 70, 160, 240, 20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_ok Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send(GUICtrlRead($Input_text)) EndSelect WEnd Exit Random
spyrorocks Posted February 11, 2007 Posted February 11, 2007 #include <GuiConstants.au3> $password = "mypass"; $in = InputBox ("Password required", "Please enter the password to continue...") if @error then exit if $in <> $password then msgbox(0, "", "Incorrect password.") exit endif GuiCreate("Enter Text To Notepad", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Label_info = GuiCtrlCreateLabel("Enter text below:", 50, 20, 280, 20) $Input_text = GuiCtrlCreateInput("text", 50, 100, 290, 20) $Button_ok = GuiCtrlCreateButton("Button3", 50, 210, 290, 40) $Label_ok = GuiCtrlCreateLabel("Click ok button to send text to notepad", 70, 160, 240, 20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_ok Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send(GUICtrlRead($Input_text)) EndSelect WEnd Exit basically what you want without the abort retry message box. [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center]
Hello Me You Posted February 11, 2007 Author Posted February 11, 2007 #include <GuiConstants.au3> $password = "mypass"; $in = InputBox ("Password required", "Please enter the password to continue...") if @error then exit if $in <> $password then msgbox(0, "", "Incorrect password.") exit endif GuiCreate("Enter Text To Notepad", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Label_info = GuiCtrlCreateLabel("Enter text below:", 50, 20, 280, 20) $Input_text = GuiCtrlCreateInput("text", 50, 100, 290, 20) $Button_ok = GuiCtrlCreateButton("Button3", 50, 210, 290, 40) $Label_ok = GuiCtrlCreateLabel("Click ok button to send text to notepad", 70, 160, 240, 20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_ok Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send(GUICtrlRead($Input_text)) EndSelect WEnd Exit basically what you want without the abort retry message box.thanks a lot man, my problem solved Random
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now