Fix for issue #112
This commit is contained in:
@@ -1826,8 +1826,18 @@ Public Class frmMain
|
||||
End Sub
|
||||
|
||||
Private Sub Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
|
||||
Dim oMutex As New System.Threading.Mutex
|
||||
Dim bNewInstance As Boolean
|
||||
|
||||
'Init
|
||||
Try
|
||||
oMutex = New System.Threading.Mutex(True, "GameBackupMonitor", bNewInstance)
|
||||
|
||||
'Ensure only one instance is running
|
||||
If Not bNewInstance Then
|
||||
mgrCommon.ShowMessage(frmMain_ErrorAlreadyRunning, MsgBoxStyle.Exclamation)
|
||||
ShutdownApp(False)
|
||||
Else
|
||||
SetForm()
|
||||
VerifyGameDataPath()
|
||||
LoadAndVerify()
|
||||
@@ -1855,7 +1865,11 @@ Public Class frmMain
|
||||
Else
|
||||
Me.gMonTray.Visible = True
|
||||
End If
|
||||
|
||||
GC.KeepAlive(oMutex)
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
If mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
|
||||
bInitFail = True
|
||||
|
||||
Generated
+9
@@ -2832,6 +2832,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to An instance of Game Backup Monitor is already running..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmMain_ErrorAlreadyRunning() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmMain_ErrorAlreadyRunning", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to GBM is running from a new location, the Windows startup entry has been updated..
|
||||
'''</summary>
|
||||
|
||||
@@ -1945,4 +1945,7 @@
|
||||
<data name="frmSettings_chkSessionTracking" xml:space="preserve">
|
||||
<value>Enable session tracking</value>
|
||||
</data>
|
||||
<data name="frmMain_ErrorAlreadyRunning" xml:space="preserve">
|
||||
<value>An instance of Game Backup Monitor is already running.</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user