home *** CD-ROM | disk | FTP | other *** search
/ PC Format Collection 48 / SENT14D.ISO / tech / delphi / disk12 / calldll.pak / DLLFORM.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-08-24  |  828 b   |  44 lines

  1. unit Dllform;
  2.  
  3. interface
  4.  
  5. uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls,
  6.   Buttons, SysUtils, StdCtrls;
  7.  
  8. type
  9.   TPasswordForm = class(TForm)
  10.     Edit1: TEdit;
  11.     Label1: TLabel;
  12.     BitBtn2: TBitBtn;
  13.     BitBtn1: TBitBtn;
  14.   end;
  15.  
  16. function GetPassword(Password: string): Boolean; export;
  17.  
  18.  
  19. implementation
  20.  
  21. uses Dialogs;
  22.  
  23. {$R *.DFM}
  24.  
  25. function GetPassword(Password: string): Boolean;
  26. var
  27.   PasswordForm: TPasswordForm;
  28. begin
  29.   Result := False;
  30.   PasswordForm := TPasswordForm.Create(Application);
  31.   try
  32.     with PasswordForm do
  33.       if ShowModal = mrOK then
  34.         if UpperCase(Edit1.Text) <> UpperCase(Password) then
  35.           MessageDlg('Invalid Password', mtWarning, [mbOK], 0)
  36.         else
  37.           Result := True;
  38.   finally
  39.     PasswordForm.Free;
  40.   end;
  41. end;
  42.  
  43. end.
  44.