| Class TAmLockApp (unit AmLock) |
TComponent
| Constructors |
constructor Create(AOwner: TComponent);| Functions |
destructor Destroy;
procedure OnLockUnlock;
procedure DoLockUnlock;
function HookProc(var Message: TMessage): boolean;
function IsLocked: Boolean;
function LockPWDlg: Boolean;
function RetrieveLockedStatus: Boolean;
function SaveLockedState: Boolean;
procedure SetLockedIcon (Value: TIcon);
procedure SetUnLockedIcon (Value: TIcon);
function UnlockPWDlg: Boolean;| Properties |
property LockedIcon : TIcon
property UnLockedIcon : TIcon| Events |
| Variables |
bLocked : Boolean;
FLockedIcon : TIcon;
FUnLockedIcon : TIcon;
strPassword : string;| Constructors |
constructor Create(AOwner: TComponent);==========================================================
| Functions |
destructor Destroy;install MainWindow hook - this allows us to trap WM_SYSCOMMAND messages
procedure OnLockUnlock;Call this from the main form in order to lock the application
procedure DoLockUnlock;------------------------------------------------------------------------------------} // this code actually implements the State Change // This code assumes that it is only called when needed, i.e. when the // program's locked status has actually changed.
function HookProc(var Message: TMessage): boolean;----------------------------------------------------------} // trap and handle WM_SYSCOMMAND [SC_RESTORE , SC_MAXIMIZE] messages
function IsLocked: Boolean;------------------------------------------------------------------------------------} // wrapper function to return Locked status // may be modified to do other work also at same time
function LockPWDlg: Boolean;------------------------------------------------------------------------------------} // show Lock Password Dialog
function RetrieveLockedStatus: Boolean;proc {----------------------------------------------------------} this function is useful if you choose to store the password in a persistent form between sessions
function SaveLockedState: Boolean;------------------------------------------------------------------------------------} // see comments for RetrieveLockedStatus above
procedure SetLockedIcon (Value: TIcon);------------------------------------------------------------------------------------} // Set methods for icons
procedure SetUnLockedIcon (Value: TIcon);
function UnlockPWDlg: Boolean;------------------------------------------------------------------------------------} // show UnLock Password Dialog
| Properties |
property LockedIcon : TIcon
property UnLockedIcon : TIcon| Events |
| Variables |
bLocked : Boolean;
FLockedIcon : TIcon;
FUnLockedIcon : TIcon;
strPassword : string;