Con una función bastante simple:
Código vb.net:
Ver originalFunction PrevInstance() As Boolean
If UBound(System
.Diagnostics.Process.GetProcessesByName(System
.Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then Return True
Application.DoEvents()
Else
Return False
Application.DoEvents()
End If
End Function
Y en el Load() del formulario de inicio:
Código vb.net:
Ver originalIf PrevInstance() = True Then
Application.DoEvents()
MessageBox.Show("La aplicación ya está en uso", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Application.Exit()
End If