program Measure;
uses
Forms,
windows,
UnitStart in 'UnitStart.pas' {frmStart},
Unitmain in 'Unitmain.pas' {frmMain},
PComm in 'Pcomm.pas',
UnitData in 'UnitData.pas' {frmData},
UnitAbout in 'UnitAbout.pas' {frmAbout},
UnitWave in 'UnitWave.pas' {frmWave};
Var
HMeasure:HWND;
HRet:Integer;
{$R *.res}
begin
Application.Initialize;
frmStart:=TfrmStart.Create(Application);
frmStart.Show;
frmStart.Refresh;
sleep(2000);
Application.Title := '数据自动采集系统';
HMeasure:=CreateMutex(Nil,False,'数据自动采集系统');//防止程序重复运行
HRet:=GetLastError;
If HRet<>ERROR_ALREADY_EXISTS Then
Begin
Application.CreateForm(TfrmMain, frmMain);
Application.CreateForm(TfrmData, frmData);
frmStart.Close;
Application.Run;
End
Else
Begin
Application.MessageBox('警告:你执行的程序已经运行!'+#13+#13'系统将关闭此程序!','关闭程序',MB_OK);
ReleaseMutex(HMeasure);
end;
end.