|
-
Apr 12th, 2008, 11:12 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] [2008] When I press the restart button on my pc, my code doesn't detect it...
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
-
Apr 13th, 2008, 04:10 AM
#2
Re: [2008] When I press the restart button on my pc, my code doesn't detect it...
How does your Restart work? Does it do a cold boot or does it invoke the shutdown process first?
-
Apr 13th, 2008, 04:25 AM
#3
Thread Starter
Frenzied Member
Re: [2008] When I press the restart button on my pc, my code doesn't detect it...
I have no idea, I click the button, and instant restart, no matter what's happening, so I'd guess it's a "cold boot"
Cheers
Icyculyr
-
Apr 13th, 2008, 04:32 AM
#4
Re: [2008] When I press the restart button on my pc, my code doesn't detect it...
Since it's instant, your application will not be able to detect it. The shutdown detection only works as part of the OS process.
-
Apr 13th, 2008, 04:52 AM
#5
Thread Starter
Frenzied Member
Re: [2008] When I press the restart button on my pc, my code doesn't detect it...
Ah ok, zthanks
Cheers
Icyculyr
-
Apr 13th, 2008, 07:27 AM
#6
Re: [RESOLVED] [2008] When I press the restart button on my pc, my code doesn't detect it...
I see the specs for your machine, but who made it?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|