RE: How do we know when Windows goes to Standby mode?
From: Ying-Shen Yu[MSFT] (v-yiy_at_online.microsoft.com)
Date: 03/16/04
- Next message: JohanJohansson: "Unexpected error creating debug information file"
- Previous message: Stu Smith: "Re: Aborting thread while suspended problem"
- In reply to: KPH: "RE: How do we know when Windows goes to Standby mode?"
- Next in thread: KPH: "RE: How do we know when Windows goes to Standby mode?"
- Reply: KPH: "RE: How do we know when Windows goes to Standby mode?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 16 Mar 2004 12:16:13 GMT
Hi,
Well, this is a different question to how to know the system status.
>From Windows 2000, there is an API SetSuspendState which enable you switch
the system into Standby or Hibernate state, for more information you may
referr to
<SetSuspendState>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/power/base/
setsuspendstate.asp
For how to shutdown/Logoff the system, you may use API
ExitWindows/ExitWindowsEx, however On windows 2000 and later system, if you
want to log off /Shut down/reboot the system, your program need get the a
special privilege before calling this API. For more information you may
referr to
<ExitWindowsEx>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/bas
e/exitwindowsex.asp
There is also a sample to show you how to shutdown the system, however it's
written in C++.
Unfortunately, these APIs is not included in current release of .NET
Framework. You need use them by P/Invoke. There is an sample project on
CodeProject.com
Maybe you can take reference from it.
<Timer Computer Shutdown>
http://www.codeproject.com/csharp/timercomputershutdown.asp
Best regards,
Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
- Next message: JohanJohansson: "Unexpected error creating debug information file"
- Previous message: Stu Smith: "Re: Aborting thread while suspended problem"
- In reply to: KPH: "RE: How do we know when Windows goes to Standby mode?"
- Next in thread: KPH: "RE: How do we know when Windows goes to Standby mode?"
- Reply: KPH: "RE: How do we know when Windows goes to Standby mode?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|