3 Replies - 5762 Views - Last Post: 27 July 2009 - 07:18 PM Rate Topic: -----

#1 mansi sharma   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 33
  • Joined: 19-February 09

Check if PC is in sleep mode

Posted 27 July 2009 - 12:42 AM

hello 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?

I have searched on the google,But didnt find anything...
Is This A Good Question/Topic? 0
  • +

Replies To: Check if PC is in sleep mode

#2 LoveIsNull   User is offline

  • Recovering D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 646
  • Joined: 10-March 09

Re: Check if PC is in sleep mode

Posted 27 July 2009 - 01:16 AM

Here is some stuff that might help you. You can tell the system that you want to know when these things happen, inside Microsoft.Win32 there is a SystemEvents class and PowerModeChangedEventArgs.
Also, they a google search with different or more general terms like this.
Was This Post Helpful? 0
  • +
  • -

#3 mansi sharma   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 33
  • Joined: 19-February 09

Re: Check if PC is in sleep mode

Posted 27 July 2009 - 04:26 AM

hello frnd

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




BUt event SystemEvents_PowerModeChange is not fire when i change the mode..can u help me

This post has been edited by mansi sharma: 27 July 2009 - 04:27 AM

Was This Post Helpful? 0
  • +
  • -

#4 LoveIsNull   User is offline

  • Recovering D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 646
  • Joined: 10-March 09

Re: Check if PC is in sleep mode

Posted 27 July 2009 - 07:18 PM

I don't know what to tell you because that code should work. When the computer goes in sleep mode a message box would pop up saying "Suspend" and another will say "Resume" once it comes out of it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1