detect 2nd instance

  • Thread starter Thread starter Doug Bell
  • Start date Start date
D

Doug Bell

Hi
can anyone point me in the right direction of detecting if an application is
running so that if a 2nd instance is started it can check and self
terminate?

Thanks

Doug
 
Hi Doug,

If Process.GetProcessesByName
(Process.GetCurrentProcess.ProcessName).Length > 1 Then
MessageBox.Show("Another Instance of this process is already running")
Application.Exit()
End If

Vijrag.
 
Back
Top