title: Prevent application launch if already running
body: <p>My app needs to check and see if it is already running when launching so it doesn't open a second time. I have a system tray icon that can make the application visible = False. Works great. However,
  I need to make sure the user looks at the system tray for the notifyicon if the app is already running.</p>
  
  <pre><code>Private Sub mainWindowSmall_Load(sender As Object, e As EventArgs) Handles MyBase.Load
          Dim p() As Process
          p = Process.GetProcessesByName("TSC Tool Box")
          If p.Count &gt; 0 Then
              MessageBox.Show("The TSC Tool Box is already running. Check System tray!", _
              "Warning !!!", MessageBoxButtons.OK, _
              MessageBoxIcon.Error, MessageBoxDefaultButton.Button2)
              Me.Close()
          Else
              totalOnLoad()
          End If
      End Sub
  </code></pre>
  
  <p>VB.NET | winforms</p>