unit Pswddlg;

interface

uses Windows, Classes, Graphics, Forms, Controls, StdCtrls,
  Buttons;

type
  TPasswordDlg = class(TForm)
    _Label1: TLabel;
    Password: TEdit;
    OKBtn: TBitBtn;
    CancelBtn: TBitBtn;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  PasswordDlg: TPasswordDlg;

function EnterPassword(const ATitle: string; var APassword: string): boolean;

implementation

function EnterPassword(const ATitle: string; var APassword: string): boolean;
{var c: string;}
begin
  Result := false;
  PasswordDlg := TPasswordDlg.Create(Application);
  try
    if ATitle <> '' then
      PasswordDlg._Label1.Caption := ATitle;
    if PasswordDlg.ShowModal = mrOK then begin
      APassword := PasswordDlg.Password.Text;
      Result := true;
    end;
  finally
    PasswordDlg.Free;
  end;
end;


{$R *.DFM}

end.

