58 lines
1.3 KiB
Plaintext
58 lines
1.3 KiB
Plaintext
unit MessageBoxFrom;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
|
|
|
|
type
|
|
TMessageBoxForm = class(TForm)
|
|
btnClose: TButton;
|
|
lblMessage: TLabel;
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
procedure btnCloseClick(Sender: TObject);
|
|
Constructor Create(aOwner: TComponent; sJsonData: string);
|
|
private
|
|
{ Private declarations }
|
|
context_: string;
|
|
public
|
|
{ Public declarations }
|
|
procedure CreateParams(var Params: TCreateParams); override;
|
|
end;
|
|
|
|
var
|
|
MessageBoxForm: TMessageBoxForm;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
procedure TMessageBoxForm.CreateParams(var Params: TCreateParams);
|
|
begin
|
|
inherited CreateParams(Params);
|
|
Params.ExStyle := WS_EX_APPWINDOW;
|
|
Params.WindowClass.Style := Params.WindowClass.Style or CS_DROPSHADOW;
|
|
Params.WndParent := GetDesktopWindow;
|
|
end;
|
|
|
|
Constructor TMessageBoxForm.Create(aOwner: TComponent; sJsonData: string);
|
|
begin
|
|
Inherited Create(aOwner);
|
|
context_:= sJsonData;
|
|
|
|
lblMessage.Caption:= context_;
|
|
end;
|
|
|
|
procedure TMessageBoxForm.FormClose(Sender: TObject; var Action: TCloseAction);
|
|
begin
|
|
Action := caFree;
|
|
end;
|
|
|
|
procedure TMessageBoxForm.btnCloseClick(Sender: TObject);
|
|
begin
|
|
Close;
|
|
end;
|
|
|
|
end.
|