Hello papafranck, hello CDB
About trial snippet :
1 - IsNotAllowRun ....means that if SnagScreen is not already launched, the form that will trigger it will be closed when SnagScreen is displayed. It is a control instruction.
2 - There are three things to keep in mind in the code I posted to you:
- Procedure Form1.OnShow : If you are in the correct interval of dates, it checks if you have the registration key by going to read it in the registry key via sKey := reg.ReadString('Key');
If the value is different from empty (if sKey <> ''), it reads the content (your registration key) via function CheckKey.
If the value it reads matches the one entered by the user (in fact the one you gave it), your application goes on,without displaying theSnagScreen.
Otherwise, it appears, indicating that the test time has been exceeded.
- As CDB says, a secure user key is not written in a separate table, that any good hacker (not even necessarily a good one) can go digging to find the key.
The best solution is to write this key in the registry,base what is done via the procedure frmNagScreen_bEnterKey_OnClick
- But you must allow the user to enter this key.
You then create a separate form allowing him to enter this key.
From SnagScreen, you link to this form.
The must, you allow it to do it from this screen: When you click on the link, you extend the SnagScreen by this integrated form.
But take it step by step and you will improve later .
The procedure I just mentioned will write the key entered (from the key validation form) in the registry base (reg.WriteString('Key', frmNagScreen.edKey.Text or your form.edKey.Text);
In summary, the verification of a valid key is done in three steps:
When starting your application:
-Verification of the validity of the test duration (StartDate +30)
- Reading a key in the registry. If absent and if the test date has passed, the SnagScreen appears (CheckKey function)
- If no key in the registry, possibility for the user to enter it (via your key entry form)
If you bought a version of MVD, this is how it works.
And above all, never write any key in a readable table without difficulty (but with the right tools as CDB said)
I hope this will help you. I would have given you an example of a key entry for one of my applications, but my hard drive let me down (COVID 19?)
I would have to rummage through my backup hard drive (Phew!)
JB