>>Hi I'm a beginner and I want to know an easy way to make sure your application is only running once and how to implement it Thank you
>
>Check
Implementation of the Win32 Event object File #
9807. It shows how to use windows Event object to implement single-instance app. Here's another one
Re: Only open application once Message #
585856. It uses windows Mutex.
Another thing to keep in mind is that if the application is on a network and you don't want any other user to be able to access the app while someone else is using it you'll need to implement a method to have a shared file that has a record that is locked by the first one to run it. The methods mentioned above (I believe) work only if you are trying to prevent multiple instances of an app on the same machine. Preventing it on different machines accessing a common directory is a different problem.
I used the record locking method on one of my apps lately (primarily to keep multiple instances off of one machine) and it's saved me a couple of times from accidentally running an app on two different boxes.
Larry Huisingh
Lockheed Martin Information Technology
Richland WA USA