Custom (GUI-Based) version of the Build-in function InputBox():
;=============================================================================== ; ; Function Name: _InputBox() ; Description: Custom InputBox Function (GUI based). ; Parameter(s): $Title - The title of the Input Box. ; $Prmt - A message to the user indicating what kind of input is expected. ; $sDef - [Optional] The value that the input box starts with. ; $hWnd - [Optional] Window handle of the parent. ; $IsPass - [optional] If <> 0 Then typed characters will be replaced with password characters (*). ; $IsDig - [optional] If <> 0 Then only numbers can by typed to the input. ; $Limit - [optional] Limit the input for accept N characters. ; $W - [optional] The width of the window. Use -1 for default width (200). ; $H - [optional] The height of the window. Use -1 for default height (150). ; $Left - [optional] The left side of the input box. By default (-1), the box is centered. ; $Top - [optional] The top of the input box. By default (-1), the box is centered. ; $Style - [optional] Defines the style of the GUI window (forced style(s): $WS_SIZEBOX). ; $exStyle - [optional] Defines the extended style of the GUI window. -1 is the default. ; $iTOut - [optional] How many seconds to wait before automatically cancelling the InputBox. ; ; Requirement(s): #include <GuiConstants.au3>. ; Return Value(s): String that was typed to the Input. ; Author(s): G.Sandler (a.k.a CreatoR). ; Note(s): None. ; ;===============================================================================
Example + UDF:
_InputBox.au3 2.9K
210 downloads[NEW]
_InputBox.au3 4.71K
936 downloads========================================
EDIT 1:
Added $Timeout param
EDIT 2:
Added focus of input when window is shown.
EDIT 3:
Added $IsDigits param - it allows to set the behaviour of typing in the input - if this parametr set to 1, then only digits can be typed in the InputBox.
EDIT 4:
Change the way that parent window is disabled (now its by WinSetState() - so its' work not just for Gui).
EDIT 5:
Change te example, now there is no parent gui, the inputbox is “attached” to currently active window.
EDIT 6:
Change the function completly - * Now it is possible to set limit for entered string, * the promt text is displayed more correct now, * and the input text are scrollable now ($ES_AUTOHSCROLL).
EDIT 7:
The Example + UDF attached to the post.
+ Little "cosmetic corrections" in the functions.
EDIT 8: (19.11.2007)
+ Added full description/comments to the main function.
* Changed example a little.
* Now the function and the example required #include <GuiConstants.au3> (see bellow why).
* The function now is stripped from “Magic Numbers”
Edited by MrCreatoR, 28 July 2012 - 05:49 PM.








