我写的代码,看看吧
program ContentPRJ;
uses
Dialogs,
Windows,
Forms,
UnitContent in 'UnitContent.pas' {FormContent},
UnitConst in 'UnitConst.pas',
ConnectFunc in 'ConnectFunc.pas',
UnitCBMSConst in 'UnitCBMSConst.pas',
UnitDataModule in 'UnitDataModule.pas' {DataModule1: TDataModule},
UnitAddContent in 'UnitAddContent.pas' {FormAddContent},
UnitUpload in 'UnitUpload.pas' {FormUpload},
UnitLPARTITION in 'UnitLPARTITION.pas' {FormLPARTITION},
UnitMediaPlayer in 'UnitMediaPlayer.pas' {FormMediaPlayer},
UnitDATTOMPG in 'UnitDATTOMPG.pas' {FormDATTOMPG},
UnitBase in 'UnitBase.pas' {BaseForm},
UnitModifyContent in 'UnitModifyContent.pas' {FormModifyContent},
UnitBatchUpload in 'UnitBatchUpload.pas' {FormBatchUpload},
UnitDownload in 'UnitDownload.pas' {FormDownload},
UnitChangeName in 'UnitChangeName.pas' {FormChangeName},
CBNLoginAttest in 'CBNLoginAttest.pas',
UnitDataExchange in 'UnitDataExchange.pas' {FormDataExchange},
UnitLogin1 in 'UnitLogin1.pas' {FormLogin1},
XPBarMenu in 'XPBarMenu.pas',
XPMenu in 'XPMenu.pas',
UnitLogin in 'UnitLogin.pas' {FormLogin},
UnitAbout in 'UnitAbout.pas' {FormAbout};
{$R *.res}
var
hMutex : HWND;
Ret : Integer;
begin
Application.Initialize;
Application.Title := 'CSMS3.0 Program Manage Module' ;
hMutex:=CreateMutex(nil,False,'CSMS3.0 Program Manage Module');
Ret:=GetLastError;
If Ret<>ERROR_ALREADY_EXISTS Then
Begin
Application.CreateForm(TFormContent, FormContent);
Application.CreateForm(TDataModule1, DataModule1);
Application.CreateForm(TFormAddContent, FormAddContent);
Application.CreateForm(TFormUpload, FormUpload);
Application.CreateForm(TFormLPARTITION, FormLPARTITION);
Application.CreateForm(TFormMediaPlayer, FormMediaPlayer);
Application.CreateForm(TFormDATTOMPG, FormDATTOMPG);
Application.CreateForm(TBaseForm, BaseForm);
Application.CreateForm(TFormModifyContent, FormModifyContent);
Application.CreateForm(TFormBatchUpload, FormBatchUpload);
Application.CreateForm(TFormDownload, FormDownload);
Application.CreateForm(TFormChangeName, FormChangeName);
Application.CreateForm(TFormDataExchange, FormDataExchange);
Application.CreateForm(TFormLogin1, FormLogin1);
Application.CreateForm(TFormLogin, FormLogin);
Application.CreateForm(TFormAbout, FormAbout);
Application.Run;
end
else
MessageBox(application.handle,'程序已经启动,无需再次运行','提示',MB_ICONASTERISK or MB_OK);
ReleaseMutex(hMutex);
end.