Aplikasi bisa dijalankan sekali saja


Tips & Trik Delphi, Tips Belajar Delphi, Belajar Delphi Online
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type

TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

const
NamaAtom =’Program versi demo‘;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
var
atom : integer;
begin
if GlobalFindAtom(NamaAtom) = 0 then
atom := GlobalAddAtom(NamaAtom)
else
begin
ShowMessage(‘Program ini hanya dapat dijalankan sekali dalam satu sesi Windows’ + #10 + #13 +
‘Untuk menjalankan program ini lagi, restart komputer Anda atau silakan‘ + #10 + #13 +
REGISTER !!‘);
Application.Terminate;
end;
end;

end.

TransCODE Software





Form Selalu Tampil Didepan


Tips & Trik Delphi, Tips Belajar Delphi, Belajar Delphi Online
unit Unit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Label1: TLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.FormStyle:=fsStayOnTop;
end;

end.

TransCODE Software