diff options
author | sr55 <[email protected]> | 2007-08-31 12:23:42 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2007-08-31 12:23:42 +0000 |
commit | bdd995d08b5a4e7a72063ac58b8c47d629f2a070 (patch) | |
tree | 9979fdc47adb4cc5311f425cbc14e8b8b789219b /win/C#/frmQueue.cs | |
parent | 18da7f138f5be947f1f904a78253ddaf39378a60 (diff) |
WinGui:
- Cleaned up the Options window a bit.
- Added On Encode Complete Options (in options)
- A few small UI tweaks.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@908 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmQueue.cs')
-rw-r--r-- | win/C#/frmQueue.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index c61b907c4..add7c456f 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -7,6 +7,7 @@ using System.Text; using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;
+using System.Runtime.InteropServices;
namespace Handbrake
{
@@ -37,6 +38,13 @@ namespace Handbrake * Code to Handle the CLI and updating of the UI as each process is completed.
*
*/
+
+ [DllImport("user32.dll")]
+ public static extern void LockWorkStation();
+ [DllImport("user32.dll")]
+ public static extern int ExitWindowsEx(int uFlags, int dwReason);
+
+
private void startProc(object state)
{
started = true;
@@ -60,6 +68,29 @@ namespace Handbrake }
started = false;
resetQueue();
+
+ // Do something whent he encode ends.
+ switch (Properties.Settings.Default.CompletionOption)
+ {
+ case "Shutdown":
+ System.Diagnostics.Process.Start("Shutdown", "-s -t 60");
+ break;
+ case "Log Off":
+ ExitWindowsEx(0, 0);
+ break;
+ case "Suspend":
+ Application.SetSuspendState(PowerState.Suspend, true, true);
+ break;
+ case "Hibernate":
+ Application.SetSuspendState(PowerState.Hibernate, true, true);
+ break;
+ case "Lock System":
+ LockWorkStation();
+ break;
+ default:
+ break;
+ }
+
MessageBox.Show("Encode Queue Completed!", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
|