Hello, I have this code at the very top of the open event of App...
#if TargetWin32 then 'The code looks like this: Class App Inherits Application 'Private Dim mMutex as Mutex 'Make a property in App named mMutex as Mutex and make it Global - not Private 'Sub Open() - In the Open event of App // Create the mutex with your application's name mMutex = new Mutex( "myApp.exe" ) // Now try to enter the mutex if not mMutex.TryEnter then Quit // Since we failed, someone else has a lock on the mutex. - Another instance of myApp.exe is open end if #endif
and I made a property in App named mMutex as Mutex and I made it Global - not Private
OK, when a second attempt of launching myApp is made the mutex prevents a new window of MyApp from opening as expected, but if I check with Task manager I see that there is another Process of myApp running.
How can I end that other process of myApp programatically?
Thanks.
Lennox
|