by Isbat Sakib (4 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating:
(10 Votes)
If you want your program to have only one instance, then there exists VB's in-built way to do it, the App.PrevInstance property. But it does not work if you copy your exe file elsewhere and then run (at least in my machine, Win98). So, here is another approach that guarantees only one instance of your app whether it is copied to different paths or renamed unless any serious error has occurred. You have to compile it to see the effect. And it will also work if the application has crashed for some reason. The code is fairly commented, hope it will help somebody. Please report bugs or any problem in this method of avoiding multiple instances. I will appreciate comments greatly.######Special thanks to LiTe for first pointing out that there is a problem in my previous method. However, it is solved now.
Download Avoid multiple instances by using Mutexes (much stronger than App.PrevInstance) (4 KB)
No comments have been posted about Avoid multiple instances by using Mutexes (much stronger than App.PrevInstance). Why not be the first to post a comment about Avoid multiple instances by using Mutexes (much stronger than App.PrevInstance).