Tips and tricks for .NET using ASP and VB code.

Log when another copy of the program was started.

        Private Sub MyApplication_StartupNextInstance(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs) Handles Me.StartupNextInstance
e.BringToForeground = True
If Application.IsSingleInstance = True Then
Debug.Write("An attempt to open another copy of this program was thwarted.")
Else
Debug.Write("Another copy of this program has been started.")
End If
End Sub

No comments:

Post a Comment

Search This Blog