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 »

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: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: Plugin OnShowMessage

Post by Enigma »

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 »

Thanks, I'm using a case statement as it's a little easier to maintain
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: Plugin OnShowMessage

Post by Enigma »

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