How to find whether our application is already running

Discussion in 'C++' started by LaHiRU, Aug 24, 2009.

  1. LaHiRU

    LaHiRU Guest

    LaHiRU, Aug 24, 2009
    #1
    1. Advertisements

  2. Pascal J. Bourguignon, Aug 24, 2009
    #2
    1. Advertisements

  3. A portable way is to use file locking (although the APIs are different for
    Windoze/POSIX). An application starts, creates a file with the same pathname and
    then tries to lock it. If locking succeeds this is the first instance of
    application. When the application terminates for any reason the operating system
    releases the file lock.
     
    Maxim Yegorushkin, Aug 24, 2009
    #3
  4. Juha Nieminen, Aug 24, 2009
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.