/Source Code/PowerSong/ApplicationEvents.vb
Visual Basic | 26 lines | 15 code | 9 blank | 2 comment | 0 complexity | 40b0a253332201fca5c21e034e30cde0 MD5 | raw file
- Namespace My
-
- Partial Friend Class MyApplication
-
- Private Sub MyApplication_StartupNextInstance(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs) Handles Me.StartupNextInstance
-
- ' Bring to foreground
- e.BringToForeground = True
-
- ' Check if a file needs to be opened
- If e.CommandLine.Count > 0 Then
- Dim FileName As String = e.CommandLine.Item(0)
- LoadExternalFile(FileName)
- End If
-
- End Sub
-
- Private Sub MyApplication_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException
- Call (New frmException(e.Exception)).ShowDialog()
- e.ExitApplication = False
- End Sub
-
- End Class
-
- End Namespace
-