ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/NexusPowerControl/trunk/NexusPowerCommand/win32api.cs
Revision 38 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 25 10:20:40 2011 UTC (12 years, 1 month ago) by william
File length: 3896 byte(s)
Diff to previous 37 (colored)
*** 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

Revision 37 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 25 10:16:08 2011 UTC (12 years, 1 month ago) by william
File length: 6364 byte(s)
Diff to previous 36 (colored)
try TokenAduster.SetPrivilege with ExitWindowsEx (for shutdown and reboot)

Revision 36 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 25 09:59:44 2011 UTC (12 years, 1 month ago) by william
File length: 5471 byte(s)
Diff to previous 35 (colored)
Obtained TokenAdjuster from: http://www.dotnet247.com/247reference/msgs/58/292150.aspx

Revision 35 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 25 09:25:32 2011 UTC (12 years, 1 month ago) by william
File length: 4930 byte(s)
Diff to previous 34 (colored)
mboShutdownParams["Flags"] = flags.ToString(); -> mboShutdownParams["Flags"] = (int)flags;

Revision 34 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 25 09:24:35 2011 UTC (12 years, 1 month ago) by william
File length: 4936 byte(s)
Diff to previous 33 (colored)
Add: WMI Impersonation
Update Enum:
internal enum WMIShutdownRebootFlags
{
    Shutdown = 1,
    Reboot = 2,
}

Revision 33 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 25 09:20:38 2011 UTC (12 years, 1 month ago) by william
File length: 4863 byte(s)
Diff to previous 32 (colored)
display message boxes with exception thrown by wmi when executing shutdown or reboot

Revision 32 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 25 08:55:24 2011 UTC (12 years, 1 month ago) by william
File length: 4769 byte(s)
Diff to previous 31 (colored)
*** use WMI for shutdown/reboot

Revision 31 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 25 08:39:03 2011 UTC (12 years, 1 month ago) by william
File length: 3710 byte(s)
Diff to previous 30 (colored)
minor changes to code

Revision 30 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 25 08:27:13 2011 UTC (12 years, 1 month ago) by william
File length: 3699 byte(s)
Diff to previous 29 (colored)
*** reference: system.windows.forms
Sleep Stub: public static bool Sleep() { return Application.SetSuspendState(PowerState.Hibernate, false, false); }

Revision 29 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 25 08:11:08 2011 UTC (12 years, 1 month ago) by william
File length: 3612 byte(s)
Diff to previous 28 (colored)
add code stubs for:
+ Shutdown
+ Restart
+ Logoff
+ Sleep

Revision 28 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 25 07:59:36 2011 UTC (12 years, 1 month ago) by william
File length: 491 byte(s)
Copied from: trunk/NexusPowerCommand/Win32API.cs revision 27
Diff to previous 27 (colored)
rename: Win32API.cs -> win32api.cs
Revision 27 - (view) (download) (annotate) - [select for diffs]
Added Tue Oct 25 07:58:02 2011 UTC (12 years, 1 month ago) by william
Original Path: trunk/NexusPowerCommand/Win32API.cs
File length: 491 byte(s)
implement lockscreen

Convenience Links

Links to HEAD: (view) (download) (annotate)

Compare Revisions

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.

  Diffs between and
  Type of Diff should be a