Real Software Forums
http://forums.realsoftware.com/

How to compile a Windows app to run as single instance only
http://forums.realsoftware.com/viewtopic.php?f=6&t=44707
Page 1 of 1

Author:  Oskar [ Fri Jul 13, 2012 3:37 pm ]
Post subject:  How to compile a Windows app to run as single instance only

Is there any quick way to force a Windows app to run as single instance only, i.e. if user double-clicks on icon when the app is alredy running it won't open a second main window instance, like on Mac?

Regards,
- Oskar

Author:  MonkeybreadSoftware [ Fri Jul 13, 2012 3:43 pm ]
Post subject:  Re: How to compile a Windows app to run as single instance o

Please check mutex class in docs.

Greetings
Christian

Author:  Oskar [ Fri Jul 13, 2012 5:48 pm ]
Post subject:  Re: How to compile a Windows app to run as single instance o

Thanks a lot, Christian.

Regards,
- Oskar

Author:  RicSum [ Tue Jul 24, 2012 3:30 am ]
Post subject:  Re: How to compile a Windows app to run as single instance o

Hi,
this is what I use:

Hope it helps.

pMutex = New Mutex("myBrilliantApp")
If not pMutex.TryEnter Then
MsgBox("myBrilliantApp is already running !")
Quit()
End If

Author:  Oskar [ Tue Jul 24, 2012 1:37 pm ]
Post subject:  Re: How to compile a Windows app to run as single instance o

Thanks, I sorted it with the same trick.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/