Add a CHMlicense object to your project (e.g. CHMlicense1). The object can be found with the other Chameleon components.
Chameleon Components Shown Above a Form
Use the following code (or something similar) to use the object:
procedure TForm1.Button1Click(Sender: TObject);
var
Registered,RegistrationCode,MachineId : string;
begintry//Print true if machine is registered.
if CHMlicense1.IsLicensed then
Registered := 'true'else
Registered := 'false';
ShowMessage( 'Machine is registered: ' + Registered );
//Fetch the machine id.
MachineId := CHMlicense1.MachineId;
ShowMessage( 'The machine id is : ' + MachineId );
//Set a proxy if required.
//License.Proxy = "webproxy.acme.com";
//Fetch the registration code.
RegistrationCode := CHMlicense1.FetchRegistrationCode(MachineId,
'your.name@yourcompany.com',
'password01',
'My Development Code');
//Register this machine with this code.
CHMlicense1.RegisterHost(RegistrationCode);
except
on E : Exception do
ShowMessage( E.Message )
end;
end;