Detecting previous instance of program


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Detecting previous instance of program

  1. #1
    Danny Guest

    Detecting previous instance of program


    How can I detect that a program is already running, so that if the user tries
    to execute it again, it doesnt launch multiple instances of the same program?

    Thanks,
    Danny

  2. #2
    www.planeteer.ca/~zalmoxe Guest

    Re: Detecting previous instance of program


    WinMain() or ::InitInstance()
    {
    if (hM =OpenMutex("MYMUTEX"))
    //progtam already running

    HANDLE hM = CreateMutex("MYMUTEX");

    ....
    ....
    //very end before exit in to the system
    ReleaseMutex(hM);
    CloseHandle(hM); // somthing like that. check the documetation about
    Mutexes

    }



    "Danny" <danny.price@ind.alcatel.com> wrote:
    >
    >How can I detect that a program is already running, so that if the user

    tries
    >to execute it again, it doesnt launch multiple instances of the same program?
    >
    >Thanks,
    >Danny



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center