Fixes for issue #109 and #112

This commit is contained in:
MikeMaximus
2017-12-08 22:09:08 -06:00
parent 476ec70fe5
commit 7330c5bcba
7 changed files with 84 additions and 75 deletions
+10 -8
View File
@@ -1825,16 +1825,20 @@ Public Class frmMain
oProcess.StartTime = Now : oProcess.EndTime = Now
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
Private Function IsGBMRunning() As Boolean
Dim prsList() As Process = Process.GetProcessesByName("GBM")
If prsList.Length > 1 Then
Return True
Else
Return False
End If
End Function
Private Sub Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'Init
Try
oMutex = New System.Threading.Mutex(True, "GameBackupMonitor", bNewInstance)
'Ensure only one instance is running
If Not bNewInstance Then
If IsGBMRunning() Then
mgrCommon.ShowMessage(frmMain_ErrorAlreadyRunning, MsgBoxStyle.Exclamation)
ShutdownApp(False)
Else
@@ -1865,8 +1869,6 @@ Public Class frmMain
Else
Me.gMonTray.Visible = True
End If
GC.KeepAlive(oMutex)
End If
End If