Any questions? Ask us: support@enigmaprotector.com

Plugin OnShowMessage

Questions, downloads, issues related to plugins for Enigma Protector

Plugin OnShowMessage

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

Re: Plugin OnShowMessage

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

Re: Plugin OnShowMessage

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

Thanks, I'm using a case statement as it's a little easier to maintain
Kymoto
 
Posts: 4
Joined: Tue Dec 03, 2013 9:34 pm

Re: Plugin OnShowMessage

Postby 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.
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 1 guest