/[NexusPowerControl]/trunk/NexusPowerCommand/win32api.cs
ViewVC logotype

Diff of /trunk/NexusPowerCommand/win32api.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- 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.Linq;
 using System.Text;
 using System.Runtime.InteropServices;
+using System.Windows.Forms;
 
 namespace NexusPowerCommand
 {
@@ -86,7 +87,7 @@
         
         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
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22