home *** CD-ROM | disk | FTP | other *** search
- unit PassForm;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, Buttons;
-
- type
- TPasswordForm = class(TForm)
- PasswordField: TEdit;
- OKButton: TBitBtn;
- CancelButton: TBitBtn;
- Prompt: TLabel;
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- PasswordForm: TPasswordForm;
-
- function GetPassword(APassword: PChar): WordBool; export;
-
- implementation
-
- {$R *.DFM}
-
- function GetPassword(APassword: PChar): WordBool;
- begin
- Result := False;
- PasswordForm := TPasswordForm.Create(Application);
- try
- if PasswordForm.ShowModal = idOK then
- if CompareText(PasswordForm.PasswordField.Text, StrPas(APassword)) = 0 then
- Result := True
- else MessageDlg('Invalid password', mtWarning, [mbOK], 0);
- finally
- PasswordForm.Free;
- end;
- end;
-
- end.
-