I Have the following project file
But the IDE keeps on spontaneously putting in an extra
Application.CreateForm(TMainForm, MainForm);
Any way to prevent this (bar flagging the file RO)
Regards
Neven
begin
{Attempt to create a named mutex}
CreateMutex(nil, false, 'MWK-Athena');
{if it failed then there is another instance}
if GetLastError = ERROR_ALREADY_EXISTS then begin
{Send all windows our custom message - only our other}
{instance will recognise it, and restore itself}
SendMessage(HWND_BROADCAST, RegisterWindowMessage('MWK-Athena'), 0, 0);
Halt(0);
end;
Application.Initialize;
with TSplashForm.Create(nil) do
try
if FindWindow('TAppBuilder',nil) = 0 then // ide not running
begin
Show; // show a splash screen
Update; // force display
end;
Application.Title := 'MWK Athena';
Application.CreateForm(TADataModule, ADataModule);
if ADataModule.Active then
begin
Application.CreateForm(TMainForm, MainForm);
Application.CreateForm(TDBUpdateErrorDlg, DBUpdateErrorDlg);
end;
finally
Free;
end;
Application.Run;
end.
Regards Neven
N.K. MacEwan B.E. E&E
Ph 649 574 0027
Fax 649 570 2706
Mobile 025 749 062
[EMAIL PROTECTED]
[EMAIL PROTECTED]
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"