*** remove old wmi shutdown/reboot code +++ using TokenAdjuster.SetPriviledge with SeShutdownPrivilege causes shutdown and reboot to work just like logoff (all operations disaply the default 'force/cancel' dialog under windows7/vista
try TokenAduster.SetPrivilege with ExitWindowsEx (for shutdown and reboot)
Obtained TokenAdjuster from: http://www.dotnet247.com/247reference/msgs/58/292150.aspx
mboShutdownParams["Flags"] = flags.ToString(); -> mboShutdownParams["Flags"] = (int)flags;
Add: WMI Impersonation Update Enum: internal enum WMIShutdownRebootFlags { Shutdown = 1, Reboot = 2, }
display message boxes with exception thrown by wmi when executing shutdown or reboot
*** use WMI for shutdown/reboot
minor changes to code
*** reference: system.windows.forms Sleep Stub: public static bool Sleep() { return Application.SetSuspendState(PowerState.Hibernate, false, false); }
add code stubs for: + Shutdown + Restart + Logoff + Sleep
rename: Win32API.cs -> win32api.cs
implement lockscreen
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.