Class TAmLockApp (unit AmLock) |
Inherits from
TComponent
constructor Create(AOwner: TComponent);
- ==========================================================
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.
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
property LockedIcon : TIcon
property UnLockedIcon : TIcon
bLocked : Boolean;
FLockedIcon : TIcon;
FUnLockedIcon : TIcon;
strPassword : string;
constructor Create(AOwner: TComponent);
==========================================================
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
property LockedIcon : TIcon
property UnLockedIcon : TIcon
bLocked : Boolean;
FLockedIcon : TIcon;
FUnLockedIcon : TIcon;
strPassword : string;