Pronunciation / adjective
Bringing something good and unforseen.
    Skip Navigation Links > Code Repository
   

Check if an application is already running



 
Return

Check if an application is already running

Don't want to allow a second instance of an application to run?

  1. If Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName).Length > 1 Then
  2. MessageBox.Show("There is already an instance of this application running.", "Startup Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  3. Me.Close()
  4. End If


Return
Microsoft Certified Professional   © 2018 Fortunate.  All rights reserved.
contact: justin@aboutfortunate.com