/[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:27:13	30
+++ trunk/NexusPowerCommand/win32api.cs	2011/10/25 08:39:03	31
@@ -13,7 +13,7 @@
         [DllImport("user32.dll")]
         private static extern bool LockWorkStation();
         [DllImport("user32.dll")]
-        static extern bool ExitWindowsEx(uint uFlags, uint dwReason);
+        static extern bool ExitWindowsEx(win32api.enums.ExitWindows uFlags, win32api.enums.ShutdownReason dwReason);
         #endregion
 
         #region win32api enums
@@ -82,10 +82,10 @@
         #region win32api wrappers
 
 
-        public static bool Shutdown() { return win32api.ExitWindowsEx((uint)win32api.enums.ExitWindows.ShutDown, (uint)(win32api.enums.ShutdownReason.MajorOther | win32api.enums.ShutdownReason.MinorOther)); }
-        public static bool Restart() { return win32api.ExitWindowsEx((uint)win32api.enums.ExitWindows.Reboot, (uint)(win32api.enums.ShutdownReason.MajorOther | win32api.enums.ShutdownReason.MinorOther)); }
+        public static bool Shutdown() { return win32api.ExitWindowsEx(win32api.enums.ExitWindows.ShutDown, win32api.enums.ShutdownReason.MajorOther & win32api.enums.ShutdownReason.MinorOther); }
+        public static bool Restart() { return win32api.ExitWindowsEx(win32api.enums.ExitWindows.Reboot, win32api.enums.ShutdownReason.MajorOther & win32api.enums.ShutdownReason.MinorOther); }
         
-        public static bool LogOff() { return win32api.ExitWindowsEx((uint)win32api.enums.ExitWindows.LogOff, (uint)(win32api.enums.ShutdownReason.MajorOther | win32api.enums.ShutdownReason.MinorOther)); }
+        public static bool LogOff() { return win32api.ExitWindowsEx((uint)win32api.enums.ExitWindows.LogOff, win32api.enums.ShutdownReason.MajorOther & win32api.enums.ShutdownReason.MinorOther); }
         public static bool LockScreen() { return win32api.LockWorkStation(); }
         public static bool Sleep() { return Application.SetSuspendState(PowerState.Hibernate, false, false); }
         #endregion

 

  ViewVC Help
Powered by ViewVC 1.1.22