Plugin OnShowRegistrationDialog

Questions, downloads, issues related to plugins for Enigma Protector
Post Reply
Kymoto
Posts: 4
Joined: Tue Dec 03, 2013 9:34 pm

Plugin OnShowRegistrationDialog

Post by Kymoto »

Hi,

I am trying to show my own custom form using the OnShowRegistrationDialog plugin function however when the function is called I am getting the following error message:

---------------------------
The Enigma Protector
---------------------------
Internal Protection Error, please contact to author!
---------------------------
OK
---------------------------

I have created a new blank form (TForm1 which is listed in the uses section as Unit1) and I'm using the following to create and display it:

Code: Select all

function Enigma_Plugin_OnShowRegistrationDialog : boolean;
var
  Dialog: TForm1;
begin
  Dialog := TForm1.Create(nil);
  try
    Dialog.ShowModal;
  finally
    Dialog.Free;
  end;
  Result := True;
end;
However if I don't use the visual form (TForm1) and just call the TForm.Create(nil) directly, the form is displayed fine.

Any help with this would be great

Thanks,
Tim
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: Plugin OnShowRegistrationDialog

Post by Enigma »

Unfortunately, the way you are trying won't work with Enigma Protector. The problem happens due to specific of the Delphi, and how it shows forms.

As far as I remember, this problem can be solved if you call this method of the form create:

Code: Select all

Dialog := TForm1.CreateNew();
With CreateNew it should work. But for such form you will have to create all form element/control yourselves, DFM form won't work.

Also, light weight implementation would be by using Windows API function only, like CreateWindow etc, it will also work.
Kymoto
Posts: 4
Joined: Tue Dec 03, 2013 9:34 pm

Re: Plugin OnShowRegistrationDialog

Post by Kymoto »

Using the CreateNew function has allowed me to create the new form which in turn has I can do what I wanted to do with the form (override the Creation, CreateParams & CreateWnd).

With the original dialog I was creating the controls from code anyway, so it just required a quick copy & paste

Thanks for the pointers.

Tim
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: Plugin OnShowRegistrationDialog

Post by Enigma »

OK, you are welcome.
Post Reply