Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Sep 19, 2019 4:32 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: How to allow only one instance of the app running
PostPosted: Mon Jan 16, 2012 8:11 am 
Offline

Joined: Sat Mar 12, 2011 9:18 am
Posts: 71
As the title says, this example will allow only one running copy of your aplication.

In the App class add a Propriety "pMutex" as a Mutex,
And then add this code in the App.Open event
pMutex = New Mutex("AppNameHere")
If not pMutex.TryEnter Then
MsgBox "Sorry. Only one instance allowed running."
Quit()
End If


Now try running two copies of your app. :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group