InputBox

Far Manager

InputBox

The InputBox function displays a simple dialog box allowing to enter one line of text.
int WINAPI InputBox(
  const char *Title,
  const char *Prompt,
  const char *HistoryName,
  const char *SrcText,
  char *DestText,
  int   DestLength,
  const char *HelpTopic,
  DWORD Flags
);

Parameters

Title
Iput dialog title. Can be NULL or "".
Prompt
Prompt text (text above the input line). Can be NULL or "".
HistoryName
Name of the "history" record for the input line. Set to NULL if history is not needed.
SrcText
The initial value of the input line. Can be NULL or "".
DestText
Points to the result string. Can point to the same buffer as SrcText, but you must reserve enough space.
DestLength
Size of destination buffer.
HelpTopic
Help topic for the inputbox in the format of "<FullPath>Topic", e.g.:
"<D:\\FAR\\Plugins\\Foo\\>FooInfo"

Set to NULL if help is not used.
Flags
Can be a combination of the following values (INPUTBOXFLAGS enum):
ConstantDescription
FIB_ENABLEEMPTY the function will return true even if the input line is empty.
FIB_PASSWORD used to input passwords - entered text is represented by '*' on the screen.
FIB_EXPANDENV after a successful return, any environment variables present in the input line will be replaced by their values in the DestText buffer, e.g. if the user entered '%TEMP%', then DestText will contain 'C:\TEMP'.
FIB_NOUSELASTHISTORY if SrcText is empty and HistoryName is not NULL, then do not initialize the input line from the history.
FIB_BUTTONS displays a separator and the [OK] and [Cancel] buttons below the input line. The dialog will grow by 2 lines.
FIB_NOAMPERSAND the ampersand character will not be shown in the prompt string but can instead be used to define a hotkey.

Return value

The function returns TRUE in case of successful user input, and FALSE in case of user interruption.

Remarks

FAR Manager uses this function to promt the user when creating a folder:

Example

See also: