Vindicator209 Posted November 16, 2007 Posted November 16, 2007 (edited) I remember doing this once, but I forgot, but how can I replace all characters in a gui inputbox with a *? ALSO, how can I make sure that an inputbox only contains numbers? Edited December 1, 2007 by MethodZero [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]
stampy Posted November 16, 2007 Posted November 16, 2007 ;Asks the user to enter a password. Don't forget to validate it! do $passwd = InputBox("Security Check", "Enter your password.", "", "*") Until StringIsDigit($passwd)
MrCreatoR Posted November 16, 2007 Posted November 16, 2007 how can I make sure that an inputbox only contains numbers?Check my custom _InputBox from my signature. Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Madza91 Posted November 18, 2007 Posted November 18, 2007 Hi...do $passwd = InputBox("Security Check", "Enter your password.", "", "*")Until StringIsDigit($passwd)That is ok, but resizable, how to make like that but no resizable? [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
magician13134 Posted November 18, 2007 Posted November 18, 2007 (edited) Exactly what you're looking for: expandcollapse popup$hWnd = WinGetHandle(WinGetTitle("")) $Ret = _InputBox("InputBox demo", "Type password... " & @LF & "[Only Numbers are allowed]" & @LF & "[Maximum 8 Numbers]", _ "", $hWnd, 1, 1, 8, -1, 220, -1, -1, 0, 0x00000008, 40) If Not @error And $Ret <> "" Then MsgBox(262144+64, "Returned value", "You type <" & $Ret & ">", 20) If @error = 2 And $Ret <> "" Then MsgBox(262144+64, "Returned value", "Time is out, here is what are you typed <" & $Ret & ">", 20) Func _InputBox($Title,$Promt,$Default="",$hWnd=0,$IsPassword=0,$IsDigits=0,$Limit=-1,$Width=-1,$Height=-1,$Left=-1,$Top=-1,$Style=0,$exStyle=0,$Timeout=0) Local $OldOpt = Opt("GuiOnEventMode", 0) WinSetState($hWnd, "", @SW_DISABLE) If $Width < 200 Then $Width = 200 If $Height < 150 Then $Height = 150 Local $InputGui, $OKButton, $CancelButton, $InputBoxID, $Msg, $GuiCoords, $RetValue, $RetErr=0, $InputMsg, $TimerStart $InputGui = GUICreate($Title, $Width, $Height, $Left, $Top, $Style, $exStyle, $hWnd) GUICtrlCreateLabel($Promt, 15, 5, $Width, -1) GUICtrlSetResizing(-1, 256+512) GUIRegisterMsg(0x24, "MY_WM_GETMINMAXINFO") $OKButton = GUICtrlCreateButton("OK", ($Width/2)-70, $Height-95, 60, 25) GUICtrlSetResizing(-1, 0x0240) GUICtrlSetState(-1, 2048) GUICtrlSetState(-1, 512) $CancelButton = GUICtrlCreateButton("Cancel", ($Width/2)+10, $Height-95, 60, 25) GUICtrlSetResizing(-1, 0x0240) GUICtrlSetState(-1, 2048) If $IsPassword <> 0 Then $IsPassword = 32 If $IsDigits <> 0 Then $IsDigits = 8192 $InputBoxID = GUICtrlCreateInput($Default, 20, $Height-60, $Width-40, 20, $IsPassword+$IsDigits+128, 0x00000001) GUICtrlSetResizing(-1, 0x0240) GUICtrlSetState(-1, 256) If $Limit <> -1 Then GUICtrlSetLimit(-1, $Limit) GUISetState(@SW_SHOW, $InputGui) If $Timeout > 0 Then $TimerStart = TimerInit() While 1 $InputMsg = GUIGetMsg() Switch $InputMsg Case -12 ControlFocus($InputGui, "", $OKButton) ControlFocus($InputGui, "", $CancelButton) Case -3, $CancelButton $RetValue = "" $RetErr = 1 ExitLoop Case $OKButton $RetValue = GUICtrlRead($InputBoxID) $RetErr = 0 ExitLoop EndSwitch If $Timeout > 0 And Round(TimerDiff($TimerStart)/1000) = $Timeout Then $RetValue = GUICtrlRead($InputBoxID) $RetErr = 2 ExitLoop EndIf WEnd WinSetState($hWnd, "", @SW_ENABLE) GUIDelete($InputGui) GUISwitch($hWnd) Opt("GuiOnEventMode", $OldOpt) Return SetError($RetErr, 0, $RetValue) EndFunc Func MY_WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam) Local $MinMaxInfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int",$lParam) Local $MINGuiX = 200, $MINGuiY = 150, $MAXGuiX = 400, $MAXGuiY = 300 DllStructSetData($MinMaxInfo, 7, $MINGuiX) ; Min X DllStructSetData($MinMaxInfo, 8, $MINGuiY) ; Min Y DllStructSetData($MinMaxInfo, 9, $MAXGuiX) ; Max X DllStructSetData($MinMaxInfo, 10, $MAXGuiY) ; Max Y Return 0 EndFunc Edited November 18, 2007 by magician13134 Visit Magic Soft Inc. for some of my software
Vindicator209 Posted December 1, 2007 Author Posted December 1, 2007 Ooohh...sorry, I forgot to mention a GUI Inputbox... Not a popup one... [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]
Zepx Posted December 5, 2007 Posted December 5, 2007 (edited) http://www.autoitscript.com/forum/index.php?showtopic=49712 Edited December 5, 2007 by Zepx
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