Hi
I have a question regarding Setup & Deployment. Once we complete setup and development and install that setup file another system. if we click on icon it open application. if I click on one more time it will open another application. I need to restrict if we click on multiple times it should not open application multiple times.
Can you please suggest me how do I resolve this issue?


Hirendra SisodiyaRank #258 · 9.8K reputationPosted Apr 18, 2010, 9:26 PM EDT
Me.Visible = False
Dim obj() As System.Diagnostics.Process
obj = Process.GetProcessesByName(Application.ProductName())
If obj.Length > 1 Then
MessageBox.Show("Application is already open")
Application.Exit()
Else
Me.Visible = True
End If
thanks
Please mark as answere if it helps
Sam HobbsRank #107 · 20.5K reputationPosted Apr 19, 2010, 10:49 AM EDT
Do you need to also activate the first instance, or is it adequate to just exit any addtional instances after the first one?