New topic: 

Mutex

<http://forums.realsoftware.com/viewtopic.php?t=47285>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        lenpartico          Post subject: MutexPosted: Thu Mar 14, 2013 
1:23 pm                         
Joined: Fri Sep 30, 2005 10:49 pm
Posts: 500                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   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to