ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/NexusPowerControl/trunk/NexusPowerCommand/win32api.cs
(Generate patch)

Comparing trunk/NexusPowerCommand/win32api.cs (file contents):
Revision 29 by william, Tue Oct 25 08:11:08 2011 UTC vs.
Revision 30 by william, Tue Oct 25 08:27:13 2011 UTC

--- trunk/NexusPowerCommand/win32api.cs	2011/10/25 08:11:08	29
+++ trunk/NexusPowerCommand/win32api.cs	2011/10/25 08:27:13	30
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Runtime.InteropServices;
+using System.Windows.Forms;
 
 namespace NexusPowerCommand
 {
@@ -86,7 +87,7 @@ namespace NexusPowerCommand
         
         public static bool LogOff() { return win32api.ExitWindowsEx((uint)win32api.enums.ExitWindows.LogOff, (uint)(win32api.enums.ShutdownReason.MajorOther | win32api.enums.ShutdownReason.MinorOther)); }
         public static bool LockScreen() { return win32api.LockWorkStation(); }
-        public static bool Sleep() { return false; }
+        public static bool Sleep() { return Application.SetSuspendState(PowerState.Hibernate, false, false); }
         #endregion
     }
 }