EP_RegKeyExpirationDate
EP_RegKeyExpirationDate function serves for retrieving the registration key expiration date. The registration should be generated with the Key Expiration Date option enabled. See Creating Keys for more details. See also the extended function EP_RegKeyExpirationDateEx.
Parameters
- Year - the year of the key expiration date.
- Month - the month of the key expiration date.
- Day - the day of the key expiration date.
Return Value
If the function succeeds, the return value is 1. If the function fails, the return value is 0.
Remark
The function fails in the following cases:
- there is no valid registration key;
- the registration key is not limited by time;
- the application is not protected.
Definition
Show/Hide C++ function definition
extern "C" __declspec( dllimport ) __stdcall BOOL EP_RegKeyExpirationDate( int* Year, int* Month, int* Day );
Show/Hide Delphi function definition
function EP_RegKeyExpirationDate( var Year, Month, Day : integer) : boolean; stdcall;
Show/Hide Visual Basic function definition
Public Declare Function EP_RegKeyExpirationDate Lib "enigma_ide.dll" (ByRef Year As Long, ByRef Month As Long, ByRef Day As Long) As Byte
Show/Hide C# (.NET) function definition
public class Enigma_IDE
{
[DllImport("enigma_ide.dll", CallingConvention = CallingConvention.StdCall)]
public static extern bool EP_RegKeyExpirationDate(ref Int32 Year, ref Int32 Month, ref Int32 Day);
}
Examples
Show/Hide Delphi function example
uses
enigma_ide;
procedure TfrmMain.OnRegistration(Name, Key : string);
var
wYear, wMonth, wDay : integer;
begin
if EP_RegCheckKey(PAnsiChar(Name), PAnsiChar(Key)) then
begin
if EP_RegKeyExpirationDate(wYear, wMonth, wDay) then
begin
eKeyExpiration.Color := clLime;
eKeyExpiration.Text := format('%.2d/%.2d/%.2d', [wMonth, wDay, wYear]);
end else
begin
eKeyExpiration.Color := clAqua;
eKeyExpiration.Text := 'KEY IS NOT TIME LIMITED';
end;
end;
end;
See function examples in the installation folder, Examples\KeyExpiration subfolder.
s