DI_PSWEDIT

Far Manager

DI_PSWEDIT

DI_PSWEDIT dialog item describes a password edit control. It is the same as DI_EDIT, except the text in the DI_PSWEDIT is hidden with '*' symbols.
struct FarDialogItem
{
  int Type          = DI_PSWEDIT
  int X1            = X1
  int Y1            = Y
  int X2            = X2
  int Y2            = Y (equals to Y1)
  int Focus         = Focus
  int Selected      = 0
  DWORD Flags       = Flags
  int DefaultButton = DefaultButton
  char Data[512]    = the text for editing
};

Attention! Attention!

  • This is an exemplary structure; read full description here.

Focus

Keyboard focus flag.

Flags

There are several flags applicable to the DI_PSWEDIT:
FlagDescription
DIF_DISABLE Disables user access to the password control.
DIF_READONLY Sets read-only state for the password control.
DIF_SELECTONENTRY Makes the password control always select the text when it receives focus.
DIF_NOFOCUS The dialog item cannot receive keyboard focus, but can handle other user events.

Events

EventDescription
DN_DRAWDLGITEM This event is sent to the dialog callback function just before the password box is drawn.
DN_CTLCOLORDLGITEM Plugin should pass the color attributes of the password control when this event comes. Param2 parameter:
LoWord LoByte - color of the text
                (COL_WARNDIALOGEDIT or
                 COL_DIALOGEDIT)
LoWord HiByte - color of selected text
                (COL_DIALOGEDITSELECTED)
HiWord LoByte - color of unchanged text
                (COL_DIALOGEDITUNCHANGED)
HiWord HiByte - 0 (not used)
DN_KEY This event comes after the user has pressed a key in the dialog.
DN_MOUSECLICK This event comes after the user has clicked one of the dialog items or outside the dialog with the mouse button.
DN_EDITCHANGE The text in the password field was changed.
DN_KILLFOCUS This event is sent before the password control loses focus, if the flag DIF_NOFOCUS was not used.
DN_GOTFOCUS This event is sent after the password control receives keyboard focus, if the flag DIF_NOFOCUS was not used.

Remarks

The DI_PSWEDIT control doesn't allow copying password text to the clipboard.

See also: