Chromium browser run mutiple copies of itself (you can check it in task manager when running the file):
Since multiple copies of the same protected file runs, if you enable Registration Dialog, or Splash Screen, or any protection message will be shown, it show for all running instances of protected application. However, we need it for only first copy, others should skip this.
To make splash screen showing just for one first copy, we may use plugins system of Enigma Protector.
Following code creates a mutex object in Enigma_Plugin_OnInit function. If mutex already found, Enigma does nothing, if not found - show a splash screen
Code: Select all
procedure Enigma_Plugin_OnInit;
var
errorcode : dword;
hndl : THandle;
begin
// This function is calling when the protected file is being initialized
// when main program is not initialized yet
hndl := CreateMutex(nil, false, '548fjwyn8vor8tmos8enyvlt5lw8gvnsehile');
if hndl <> 0 then
begin
errorcode := GetLastError;
if errorcode <> ERROR_ALREADY_EXISTS then
begin
EP_SplashScreenShow;
end;
end;
end;
For avoid duplication of message dialogs, we may Enigma_Plugin_OnShowMessage plugin function, the following code does what we need:
Code: Select all
var
showalways : boolean = false;
function Enigma_Plugin_OnShowMessage(AMessageID : integer) : boolean; stdcall;
var
errorcode : dword;
hndl : THandle;
begin
// This plugin function is being called all times when Enigma Protector
// needs to show any information message. See manual for detailed information
// If this function returns FALSE, the message which is set in Enigma Protector
// will be shown, otherwise it will be supressed.
Result := false;
if AMessageID = MESSAGEID_TRIAL_REMINDER then
begin
if not showalways then
begin
hndl := CreateMutex(nil, false, 'c7rtr7iawtkrtn7kawvbrjcynfryakfjkry');
if hndl <> 0 then
begin
errorcode := GetLastError;
if errorcode = ERROR_SUCCESS then
begin
showalways := true;
end else
if errorcode = ERROR_ALREADY_EXISTS then
begin
Result := true;
end;
end;
end;
end;
end;
Code: Select all
procedure Enigma_Plugin_OnInit;
var
errorcode : dword;
hndl : THandle;
begin
// This function is calling when the protected file is being initialized
// when main program is not initialized yet
if EP_RegLoadAndCheckKey then
Exit;
hndl := CreateMutex(nil, false, 'of8a4lo8thje587ghifls8htJlo8hOIHo7hyi');
if hndl <> 0 then
begin
errorcode := GetLastError;
if errorcode <> ERROR_ALREADY_EXISTS then
begin
EP_RegShowDialog;
end;
end;
end;