Skip to main content
Table of Contents

TMS FNC App Lock — Guides

Idle-timeout locking

Enable automatic locking after user inactivity by setting ActiveOnIdle to True and specifying the timeout with IdleMinutes and IdleSeconds. The component monitors input events and fires Lock when the elapsed idle time exceeds the threshold.

Inline example 1PascalC++
{ Inside FormCreate: }
AppLock1.ActiveOnIdle := True;
AppLock1.IdleMinutes := 5;
// Inside FormCreate:
AppLock1->ActiveOnIdle = true;
AppLock1->IdleMinutes = 5;

Customizing the lock dialog

Use TTMSFNCAppLockDialogLabelSettings (exposed through Dialog) to change the caption and label text shown in the built-in password dialog:

Inline example 2PascalC++
AppLock1.Dialog.Caption := 'Application Locked';
AppLock1.Dialog.Password := 'Enter password to continue';
AppLock1->Dialog->Caption = L"Application Locked";
AppLock1->Dialog->Password = L"Enter password to continue";

Custom password verification

Handle OnVerifyPassword to delegate password checking to your own logic, for example verifying against an encrypted store or an Active Directory query:

Inline example 3PascalC++
procedure TForm1.AppLock1OnVerifyPassword(Sender: TObject;
  const APassword: string; var AValid: Boolean);
begin
  AValid := MyAuthService.Verify(APassword);
end;
void __fastcall TForm1::AppLock1VerifyPassword(TObject *Sender,
  const UnicodeString APassword, bool &AValid)
{
  AValid = MyAuthService->Verify(APassword);
}

See also