我是这样做的:
program CusMana;
uses
Forms,
Windows,
MainData in 'MainData.pas' {MainDataModule: TDataModule},
HintWindow in 'HintWindow.pas' {Form_Hint},
Main in 'Main.pas' {MainForm},
..............................
SplashForm in 'SplashForm.pas' {Form_navgator};
{$R *.res}
Var
hMutex:HWND;
Ret:Integer;
begin
Application.Initialize;
Application.Title := '客户资源管理系统';
hMutex := CreateMutex(nil,False,'aaa');
Ret := GetLastError;
If Ret <> ERROR_ALREADY_EXISTS then
begin
with TForm_navgator.Create(Application)do
begin
Show;
Update;
Application.CreateForm(TMainDataModule, MainDataModule);
MyProgressBar.Position := 20;
Sleep(100);
Application.CreateForm(TMainForm, MainForm);
MyProgressBar.Position := 50;
Sleep(100);
Application.CreateForm(TForm_Hint, Form_Hint);
MyProgressBar.Position := 100;
Sleep(100);
Hide;
Free;
end;
Application.Run;
end
else
begin
Application.MessageBox('应用程序已经打开了!','请注意。。。',MB_OK);
ReleaseMutex(hMutex);
end;
end.