sands Posted April 3, 2009 Posted April 3, 2009 (edited) hello i want make a simple gui to login to my servers i have the following code... expandcollapse popupGlobal $user = "admin" Func Gui() #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1_1 = GUICreate("GUI", 381, 351, 350, 168) $Label1 = GUICtrlCreateLabel("my first gui", 20, 88, 339, 17, $SS_CENTER) $Label2 = GUICtrlCreateLabel("...", 20, 111, 339, 17, $SS_CENTER) $OK = GUICtrlCreateButton("OK", 152, 304, 76, 25, 0) GUICtrlCreateCombo("", 140, 264, 100, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "server 1|server 2", "server 1") GUICtrlCreateInput($user, 120, 208, 140, 18, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) GUICtrlCreateInput("input to $password", 120, 232, 140, 18, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL)) ; save password Global $password = "the_input" GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $OK ExitLoop EndSwitch WEnd EndFunc Gui() Sleep(50000) i want save the input password to $password to use it later in my script also i want the gui close and continue the script ExitLoop let continue but not close it how can i do that ? Edited April 3, 2009 by sands
youknowwho4eva Posted April 3, 2009 Posted April 3, 2009 for your first question, look up guictrlinput in the help file. It will show you how to save it. to close you gui, look up guidelete in the help file. Giggity
sands Posted April 4, 2009 Author Posted April 4, 2009 for your first question, look up guictrlinput in the help file. It will show you how to save it.to close you gui, look up guidelete in the help file.i can't found guictrlinput in the help filecan you copy and paste it here ?just the parameters and the examplethe other question was fixed with guidelete alrightthanks for reply
TheOnlyOne Posted April 4, 2009 Posted April 4, 2009 (edited) for closeing then use exitloop and continueloop for the other one go look in the help file after GUICtrlRead Edit here i will help you a little $password=GUICtrlCreateInput("input to $password", 120, 232, 140, 18, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL)) $readpassword= guictrlread($password) msgbox (0,"","your password is :"&$password) i dident test this but should work and print that you write in the password Edited April 4, 2009 by TheOnlyOne
CodyBarrett Posted April 4, 2009 Posted April 4, 2009 GUICtrlCreateInput () GUICtrlRead () ;OR #Include <Guiconstants.au3> #Include <EditConstants.au3> #Include <WindowsConstants.au3> opt ('Guioneventmode', 1) GUICreate ('', 200, 200) $i = GUICtrlCreateInput ('', 5, 5, 100, 20, $ES_PASSWORD) guisetonevent ($GUI_EVENT_CLOSE, '_Exit') Guisetstate () While 1 Sleep (100) wend Func _Exit () exit EndFunc [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
GEOSoft Posted April 4, 2009 Posted April 4, 2009 $Combo = GUICtrlCreateCombo("", 140, 264, 100, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "server 1|server 2", "server 1") $In_1 = GUICtrlCreateInput($user, 120, 208, 140, 18, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $in_2 = GUICtrlCreateInput("input to $password", 120, 232, 140, 18, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL)) ; save password GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $OK Global $password = GUICtrlRead($in_2) GUIDelete() ExitLoop EndSwitch WEnd George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
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