Any questions? Ask us: support@enigmaprotector.com

Plugin OnShowRegistrationDialog

Questions, downloads, issues related to plugins for Enigma Protector

Plugin OnShowRegistrationDialog

Postby Kymoto » Wed Dec 04, 2013 6:23 pm

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
Kymoto
 
Posts: 4
Joined: Tue Dec 03, 2013 9:34 pm

Re: Plugin OnShowRegistrationDialog

Postby Enigma » Thu Dec 05, 2013 9:42 am

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.
Enigma
Site Admin
 
Posts: 2181
Joined: Wed Aug 20, 2008 2:24 pm

Re: Plugin OnShowRegistrationDialog

Postby Kymoto » Thu Dec 05, 2013 6:07 pm

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
Kymoto
 
Posts: 4
Joined: Tue Dec 03, 2013 9:34 pm

Re: Plugin OnShowRegistrationDialog

Postby Enigma » Fri Dec 06, 2013 11:14 am

OK, you are welcome.
Enigma
Site Admin
 
Posts: 2181
Joined: Wed Aug 20, 2008 2:24 pm


Return to Plugins

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron