Private Sub CheckInstanceOfApp()
Dim appProc() As Process
Dim strModName, strProcName AsString
strModName = Process.GetCurrentProcess.MainModule.ModuleName
strProcName = System.IO.Path.GetFileNameWithoutExtension(strModName)
appProc = Process.GetProcessesByName(strProcName)
If appProc.Length 〉 1 Then
MessageBox.Show(“There is an instance of this application running.“)
Else
MessageBox.Show(“There are no other instances running.“)
End If
End Sub