unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, TFlatProgressBarUnit,
TFlatMemoUnit, TFlatButtonUnit, jpeg;
type
TForm1 =
class(TForm)
Button1: TButton;
ProgressBar1: TProgressBar;
Image1: TImage;
cap: TShape;
bclose: TFlatButton;
babout
: TFlatButton;
bmin: TFlatButton;
FlatButton1: TFlatButton;
FlatMemo1: TFlatMemo;
FlatButton2: TFlatButton;
FlatButton3: TFlatButton;
FlatProgressBar1: TFlatProgressBar;
Button2: TButton;
procedure FlatButton1Click(Sender: TObject);
procedure FlatButton3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure bcloseClick(Sender: TObject);
procedure baboutClick(Sender: TObject);
Procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2, Unit3;
{$R *.dfm}
procedure TForm1.FlatButton1Click(Sender: TObject);
var
hmutex: THandle;
begin
FlatButton1.enabled := false;
hmutex := CreateMutex(
NIL, FALSE, '
mutexname');
if (hmutex = 0)
OR (GetLastError = ERROR_ALREADY_EXISTS)
then
MessageBox(0, '
mutex is found =)', '
mutexsearch', MB_ICONINFORMATION)
else
MessageBox(0, '
mutex is not present', '
mutexsearch', MB_ICONINFORMATION);
end;
procedure TForm1.FlatButton3Click(Sender: TObject);
begin
form2.Show;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
form3.Show;
end;
procedure TForm1.bcloseClick(Sender: TObject);
begin
close;
end;
procedure TForm1.baboutClick(Sender: TObject);
begin
form3.Show;
end;
Procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Begin
ReleaseCapture;
Form1.Perform(WM_SYSCOMMAND, $F012, 0);
End;
end.