Displays an input box to ask the user to enter a string.
InputBox ( "title", "prompt" [, "default" [, "password char" [, width = -1 [, height = -1 [, left = Default [, top = Default [, timeout = 0 [, hwnd]]]]]]]] )
|title||The title of the input box.|
|prompt||A message to the user indicating what kind of input is expected.|
|default||[optional] The value that the input box starts with.|
|password char||[optional] The character to replace all typed characters with in the display. If you want the actual typed character to appear, define with an empty string ("") (default) or a space for the first character. If you provide a multi-character string, only the first character is used for character masking. There are special meanings for the second and subsequent characters. See Remarks.|
|width||[optional] The width of the window.|
|height||[optional] The height of the window.|
|left||[optional] The left side of the input box. By default, the box is centered.|
|top||[optional] The top of the input box. By default, the box is centered.|
|timeout||[optional] How many seconds to wait before automatically canceling the InputBox().|
|hwnd||[optional] The window handle to use as the parent for this dialog.|
|Success:||the string that was entered.|
|Failure:||"" (empty string) and sets the @error flag to non-zero.|
|@error:||1 = The Cancel button was pushed.
2 = The Timeout time was reached.
3 = The InputBox failed to open. This is usually caused by bad arguments.
4 = The InputBox cannot be displayed on any monitor.
5 = Invalid parameters width without height or left without top.
#include <MsgBoxConstants.au3> Example() Func Example() ; Places the input box in the top left corner displaying the characters as they ; are typed. Local $sAnswer = InputBox("Question", "Where were you born?", "Planet Earth", "", _ - 1, -1, 0, 0) ; Display the result. MsgBox($MB_SYSTEMMODAL, "", $sAnswer) ; Asks the user to enter a password. Don't forget to validate it! Local $sPasswd = InputBox("Security Check", "Enter your password.", "", "*") ; Display the result. MsgBox($MB_SYSTEMMODAL, "", $sPasswd) ; Asks the user to enter a 1 or 2 character response. The M in the password ; field indicates that empty string is not accepted and the 2 indicates that the ; responce will be at most 2 characters long. Local $sValue = InputBox("Testing", "Enter the 1 or 2 character code.", "", " M2") ; Display the result. MsgBox($MB_SYSTEMMODAL, "", $sValue) EndFunc ;==>Example