CantStartSingleInstanceException

SIMIN

Regular
Joined
Mar 10, 2008
Messages
92
Hope the following code snippet should be helpful for you. I believe you should be able to add this snippet appropriately to your code.
Visual Basic:
Imports Microsoft.VisualBasic.ApplicationServices

Namespace My

    ...

    Partial Friend Class MyApplication

        Private Sub MyApplication_CantStartSingleInstanceException(ByVal sender As Object, _

            ByVal e As StartupNextInstanceEventArgs) Handles Me.StartupNextInstance

            ' Take Necessary Action

            MessageBox.Show("Single Instance Only")

        End Sub

    End Class

    ...

End Namespace
 
Back
Top