unit DemoMainForm;
{$MODE Delphi}
{$codepage UTF8}
interface
uses LCLIntf, LCLType, LMessages, Messages, SysUtils, Variants, Classes,
     Graphics, Controls, Forms, Dialogs, StdCtrls, ParamsMngr;
type
  TDemoMainFrm = class(TForm)
    TestSParam: TButton;
    TestTestParam: TButton;
    TestVParamValue: TButton;
    TestMSGParamValue: TButton;
    ExitBtn: TButton;
    procedure ExitBtnClick(Sender: TObject);
    procedure TestSParamClick(Sender: TObject);
    procedure TestTestParamClick(Sender: TObject);
    procedure TestVParamValueClick(Sender: TObject);
    procedure TestMSGParamValueClick(Sender: TObject);
  private
  public
  end;
var
  DemoMainFrm: TDemoMainFrm;
implementation
{$R *.lfm}
procedure ShowDLG (const ATitle, AMessage: string);
begin
Application.MessageBox(pchar(AMessage), pchar(ATitle), MB_ICONASTERISK);
end;
procedure TDemoMainFrm.ExitBtnClick(Sender: TObject);
begin
Application.Terminate;
end;
procedure TDemoMainFrm.TestMSGParamValueClick(Sender: TObject);
begin
if HasParam(StartParams, 'msg') then
 ShowDLG(TestMSGParamValue.Caption, GetParamValue(StartParams, 'msg'))
 else
 ShowDLG(TestMSGParamValue.Caption, 'Param "/msg" not founded!');
end;
procedure TDemoMainFrm.TestSParamClick(Sender: TObject);
begin
ShowDLG(TestSParam.Caption, BoolToStr(HasParam(StartParams, 's'), true));
end;
procedure TDemoMainFrm.TestTestParamClick(Sender: TObject);
begin
ShowDLG(TestTestParam.Caption, BoolToStr(HasParam(StartParams, 'test'), true));
end;
procedure TDemoMainFrm.TestVParamValueClick(Sender: TObject);
begin
if HasParam(StartParams, 'v') then
 ShowDLG(TestVParamValue.Caption, GetParamValue(StartParams, 'v'))
 else
 ShowDLG(TestVParamValue.Caption, 'Param "/v" not founded!');
end;
end.
