Plugin OnShowMessage

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

Plugin OnShowMessage

Post by Kymoto » Tue Dec 03, 2013 9:40 pm

Hi,

I am creating a plugin to override the way messages are shown (would like to use the standard Windows message dialog/ Task dialog), but I'm not sure how to get the message text to be shown as the OnShowMessage function is using an integer as the parameter

Code: Select all

function Enigma_Plugin_OnShowMessage(AMessageID : integer) : boolean; stdcall;
How do you go about converting the passed integer to the correct sting?

Thanks
Tim

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

Re: Plugin OnShowMessage

Post by Enigma » Wed Dec 04, 2013 8:54 am

Hi Tim,

That's very simple, you may do that using the following way:

Code: Select all

function Enigma_Plugin_OnShowMessage(AMessageID : integer) : boolean; stdcall;
  begin
  if (AMessageID = MESSAGEID_CHECK_FILENAME) then
  begin
    MessageBox(0, 'Filename is incorrect!', 'Application', MB_ICONERROR);
  end else
  if (AMessageID = MESSAGEID_CHECK_EXECUTEDPROCESSES) then
  begin
    MessageBox(0, 'Bad executed process is found!', 'Application', MB_ICONERROR);
  end;
  Result := 1;
end;

Kymoto
Posts: 4
Joined: Tue Dec 03, 2013 9:34 pm

Re: Plugin OnShowMessage

Post by Kymoto » Wed Dec 04, 2013 6:17 pm

Thanks, I'm using a case statement as it's a little easier to maintain

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

Re: Plugin OnShowMessage

Post by Enigma » Thu Dec 05, 2013 9:13 am

Kymoto wrote:I'm using a case statement as it's a little easier to maintain
Sure, as you wish.

Post Reply