AV-SOFT.COM
AVLock SIMPLE
Introduction
What is AVLock Gold?
How to buy AVLock Gold?
How to Upgrade from previous versions?
What's new in version 5
Another AVlock components
License Agreement
Using AVLock Gold
How to install AVLock Gold?
How works AVLockGold?
Brief practice with demo's
Step by step samples
Basic sample
Working with modules
Creating your own registration form
Running on a network
"MoveReg" feature
Some configuration issues
Hacking cautions
How to translate AVLock Gold to any language?
Properties
Methods
Events
Useful concepts
Registration keys
KeyFiles
RegFiles and ControlFiles
RegistryKeys
MasterComputers and RegularComputers
Utilities
AVLockManager
RegMonitor
Configure
KeyGen
Php key generators
FAQs

Events

Top  Previous  Next

icon2EVENTS

(Not implemented yet into the .NET version)

 

OnStartError

 

Occurs when the program starts (start method called) and an error occurs reading the avconfig.ini file.

 

type TOnStartErrorEvent = procedure (error:integer) of object;

 

property OnStartError : TOnStartErrorEvent;

 

Description

 

Use the OnStartError event handler to give to the user information about the error happened in the start method reading the avconfig.ini file.

 

The Error parameter return a number in order to denote the kind of error happened:

  1: The avconfig.ini file not found

  2: Wrong avconfig.ini file

 

BeforeRegisterKey

 

Occurs before proceed to the registration for each key submitted in the KeyList parameter into the DoMasterReg method.

 

type TBeforeRegisterKeyEvent = procedure (RegKey:string; KeyNo, StartDate, Days, Users, ModuleNo:word; InstallCode, Name, Company:string; var Proceed:boolean) of object;

 

property BeforeRegisterKey : TBeforeRegisterKeyEvent;

 

Description

 

Use the BeforeRegisterKey event handler to give to the user information about the current key to be registered and the chance to continue or abort the registration through the Proceed  var parameter. See in the Demo3 program a sample about how to use it.

 

The RegKey parameter holds the current submitted Key.

The NeyNo parameter holds the ordinal number for the current key into the list of keys given in the KeyList parameter into the DoMasterReg method.

StartDate, Days, Users, ModuleNo and InstallCode are parameters that holds values that comes embedded into the RegKey parameter.

The StartDate parameter holds the date value from where start the authorized period.

The Days parameter holds the authorized number of days.

The Users parameter holds the simultaneous number of authorized users.

The ModuleNo parameter holds the module number, 0 for the main module and 1..254 for extra modules.

The InstallCode parameter holds a cut-out code matching with the six first digits from the InstallCode value.

The Name and Company parameters hold the values given in the DoMasterReg method.

The Proceed var parameter (True by default) can be changed in order to authorize or not the registration.

 

AfterRegisterKey

 

Occurs after the registration was done  for each key submitted in the KeyList parameter into the DoMasterReg method.

 

type TAfterRegisterKeyEvent = procedure (RegKey:string; KeyNo:word; Status: integer) of object;

 

property AfterRegisterKey : TAfterRegisterKeyEvent;

 

Description

 

Use the AfterRegisterKey event handler to give to the user information about the registration result for the current key given in the RegKey parameter. See in the Demo3 program a sample about how to use it.

 

The KeyNo parameter holds the ordinal number of registered keys.

The Status parameter return a number in order to denote the registration result as follow:

0 = Registered

1 = Key length mismatch

2 = Inexistent module

3 = Bad system date

4 = UserName mismatch

5 = Unregistered

6 = Can not register extra module without MainModule registered

7 = UserName too short

8 = Tried to register an extra module with a different username than the main module

9 = Invalid RegKey

 

AfterRegisterAll

 

Occurs after that all keys in the KeyList parameter into the DoMasteReg method have been submitted for registration.

 

type TAfterRegisterAllEvent = procedure (SubmittedKeys,RegisteredKeys:word) of object;

 

property AfterRegisterAll : TAfterRegisterAllEvent;

 

Description

 

Use the AfterRegisterAll event handler to give to the user information about the number of submitted and registered keys from the list of keys in the KeyList parameter into the DoMasterReg method after that all keys have been submitted for registration. The SubmittedKeys parameter holds the number of keys in the KeyList parameter and the RegisteredKeys parameter holds the number of keys successfully registered. See in the Demo3 program a sample about how to use it.

 

 

OnRegularRegistration

 

Occurs after that a key has been submitted for registration with the DoRegularReg method.

 

type TOnregularRegistrationEvent = procedure (Error:integer) of object;

 

property OnRegularRegistration : TOnRegularRegistrationEvent;

 

Description

 

Use the OnRegularRegistration event handler to give to the user information about the registration result for the regular key submitted with the DoRegularReg method. See in the Demo3 program a sample about how to use it.

 

The Error parameter return a number in order to denote the registration result as follow:

  0: No error (Registered)

  1: Generic Key not allowed here

  2: Invalid RegKey

  3: Can not write to Windows Registry

  4: UserName mismatch

 

OnRequestName

 

Occurs when the DoRequestName method is called.

 

type TOnRequestNameEvent = procedure (var UserName, Company:string) of object;

 

property OnRequestName : TOnRequestNameEvent;

 

Description

 

Use the OnRegularRegistration event handler to replace the standard RequestName feature by your own procedure, supplying

the UserName and Company parameters. See in the Demo3 program a sample about how to use it.

 

OnMoveReg

AfterMoveReg

 

Occurs when the MoveReg method is called.

 

type TOnMoveRegEvent = procedure of object;

    TAfterMoveRegEvent = procedure of object;

property OnMoveReg : TOnMoveRegEvent;

                 AfterMoveReg : TAfterMoveRegEvent;

 

Description

 

Use these events handlers to replace the standard MoveReg features by your own procedures.

OnMoveReg is for the step one, which get from the user the InstallCode and translates the old registration keys for the new machine.

AfterMoveReg is the step two, which displays the new registration keys. See in the Demo3 program a sample about how to use it.

 

OnMaxActiveUsers

 

Occurs when the number of active users reach the MaxUsers limit.

 

type TOnMaxActiveUsersEvent = procedure (instance:TInstance) of object;

 

property OnMaxActiveUsers : TOnMaxActiveUsersEvent;

 

TInstance = record

   UserName  : TUserName;

   LoginTime : TDateTime;

   LogoutTime: TDateTime;

   Active    : Boolean;

end;

 

Description

 

Use the OnMaxActiveUsers event handler to give to the user the chance of change the behavior when the number of active users reach the MaxUsers limit, for default for this situation bring up the "Too many active users" messagebox and the program terminates.

You can use the TInstance structure to give an customized message, e.g.

 

procedure TForm1.AVLockG51MaxActiveUsers(instance: TInstance);

begin

showmessage('Too many users : '+instance.UserName);

Application.Terminate;

end;

 

If you have any questions not answered by this help file, please don't hesitate to contact me at http://valega.com/contacto.php.