@WickedDum
A struggle it seems ?
What i did, is creating a new application. Then put a button on it, added the onclick event for the button with the project inspector. In the event (between begin ... end) i added the line:
ShowMessageEx('Hello world');
Then i literally copied over Geepster's code as being generic function in the implementation section of the form (not part of the form itself, but you can also do that if you want) so that my final form unit looked like:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure ShowMessageEx(const AMessage: string);
var
LForm: TForm;
begin
LForm := CreateMessageDialog(AMessage, mtCustom, [mbOK]);
try
with TLabel.Create(LForm) do begin
ParentColor := True;
AutoSize := False;
Alignment := taCenter;
Layout := tlCenter;
WordWrap := True;
SetBounds(0, 0, LForm.Width, (LForm.Components[0] as TControl).Top);
Caption := AMessage;
Parent := LForm;
end;
LForm.ShowModal;
finally
FreeAndNil(LForm);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessageEx('Hello world');
end;
end.
Then i compiled the application, and ran it from inside the ide, pressed the button et voila the dialog appeared.
Perhaps following the same procedure/steps is able to aid you ?