No need to use a component

in your dpr file, add all 'atom' lines

var
  RpAtom    : integer;

Const
    AtomName = 'MyAtom';

begin
  if (GlobalFindAtom(AtomName) = 0) then
    try
      RpAtom:= GlobalAddAtom(AtomName);
      Application.Initialize;
      Application.CreateForm(TForm1, Form1);
      Application.Run;
    finally
      GlobalDeleteAtom(RpAtom);
    end;


----- Original Message ----- 
From: "Rainer von Saleski" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, September 23, 2007 9:13 PM
Subject: Preventing Multiple Simultaneous Executions


> What's the best (easiest effective) way to prevent multiple copies of a 
> single Delphi program from attemtping to execute simultaneously?
> 
> The problem is that  users are double clicking to launch the program 
> (when Control Panel is configured for  single clicks), and then when 
> things aren't happening fast enough, they click twice again, and again, 
> and again, until there are 12 or more copies of the program trying to 
> launch ... and none of them are getting off the ground.  My users don't 
> seem able to learn patience, so I need to help them out.
> 
> Any ideas?
> 
> Thanks,
> Rainer
> 
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi
> 
>
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to