Switched to VB method of single instance
This commit is contained in:
@@ -1825,23 +1825,9 @@ Public Class frmMain
|
||||
oProcess.StartTime = Now : oProcess.EndTime = Now
|
||||
End Sub
|
||||
|
||||
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
|
||||
'Ensure only one instance is running
|
||||
If IsGBMRunning() Then
|
||||
mgrCommon.ShowMessage(frmMain_ErrorAlreadyRunning, MsgBoxStyle.Exclamation)
|
||||
ShutdownApp(False)
|
||||
Else
|
||||
SetForm()
|
||||
VerifyGameDataPath()
|
||||
LoadAndVerify()
|
||||
@@ -1870,8 +1856,6 @@ Public Class frmMain
|
||||
Me.gMonTray.Visible = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
If mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
|
||||
bInitFail = True
|
||||
|
||||
Generated
+1
-1
@@ -24,7 +24,7 @@ Namespace My
|
||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||
Public Sub New()
|
||||
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
|
||||
Me.IsSingleInstance = false
|
||||
Me.IsSingleInstance = true
|
||||
Me.EnableVisualStyles = true
|
||||
Me.SaveMySettingsOnExit = false
|
||||
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>true</MySubMain>
|
||||
<MainForm>frmMain</MainForm>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<SingleInstance>true</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
|
||||
Generated
-9
@@ -2832,15 +2832,6 @@ 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,7 +1945,4 @@
|
||||
<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