Check if PC is in sleep mode - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Check if PC is in sleep mode

sonu_1984sonu_1984 Posts: 6Member
ello frnds,i want to check if the computer is in sleep mode or not...Suppose my project is in normal state..I change the state to sleep mode,I want that now when the computer wakes from sleep mode,I want that my project is in minimized state..How to check dat?

[code]
Imports Microsoft.Win32

Public Class Form1
Public Sub New()
MyBase.New()


InitializeComponent()
AddHandler SystemEvents.PowerModeChanged, _
AddressOf SystemEvents_PowerModeChanged

End Sub

Private Sub SystemEvents_PowerModeChanged( _
ByVal sender As Object, _
ByVal e As PowerModeChangedEventArgs)
MsgBox(e.Mode.ToString())
End Sub

End Class
[/code]

BUt event SystemEvents_PowerModeChange is not fire when i change the mode..can somebody help me?
Sign In or Register to comment.