Hey, I've found that when I press the restart button on my pc (near the shutdown button, that my code for detecting shutdown doesn't work...

Although it works if I click restart, log off, shutdown, via the Start menu,

It just seems to not work?

Code:
Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    AddHandler Microsoft.Win32.SystemEvents.SessionEnding, AddressOf Shutdown
End Sub

Private Sub Shutdown(ByVal sender As Object, ByVal e As Microsoft.Win32.SessionEndingEventArgs)
    Using sw As New StreamWriter(My.Computer.FileSystem.SpecialDirectories.Desktop & "\RUNS.txt")
    End Using
End Sub
Does anyone know why?

Thanks
Icyculyr