Use FindWindow to search for your Main Program title bar Caption

if (FindWindow(nil, Pchar('TitleOfYourWindow')) = 0) then
  { Not Running }
else
  { Is Running }

or

if (FindWindow('TMainWindowClass', nil) = 0) then
  { Not Running }
else
  { Is Running }

TMainWindowClass is the name of the form, say TFORM1, then that this the
class name in the second example.

Chris Crowe
[EMAIL PROTECTED]
Want a free tool to help search the Microsoft BB and Search pages?, goto
http://www.adrock.com/msarticle

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Leo Ramakers
Sent: Wednesday, 13 October 1999 11:47
To: Multiple recipients of list delphi
Subject: [DUG]: Preventing a program running if a different program is
running


{I recall seeing this topic discussed a while back, but cant locate it in my
DUG archive)

I want to stop a program running (a setup program) if another program (the
main
application) is running. Any pointers?

thanks
Leo Ramakers
SoftOption


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to