diff options
author | sr55 <[email protected]> | 2010-07-15 18:15:54 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-07-15 18:15:54 +0000 |
commit | 5c8cab7ea3c07e36b74bcb8c8198f8ef796e1530 (patch) | |
tree | e12cf9ce0520fc7d90e4af595375ff73d4865507 /win/C#/HandBrake.ApplicationServices/Functions | |
parent | 9f576f433db5cd6d86af6986f66719fcff824957 (diff) |
WinGui:
- Cleanup
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3439 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/HandBrake.ApplicationServices/Functions')
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Functions/Main.cs | 49 | ||||
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Functions/Win7.cs | 2 |
2 files changed, 4 insertions, 47 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/Functions/Main.cs b/win/C#/HandBrake.ApplicationServices/Functions/Main.cs index 0696101c1..a92d2d245 100644 --- a/win/C#/HandBrake.ApplicationServices/Functions/Main.cs +++ b/win/C#/HandBrake.ApplicationServices/Functions/Main.cs @@ -5,8 +5,6 @@ namespace HandBrake.ApplicationServices.Functions
{
- using System;
- using System.Collections.Generic;
using System.Diagnostics;
/// <summary>
@@ -17,51 +15,10 @@ namespace HandBrake.ApplicationServices.Functions /// <summary>
/// Get the Process ID of HandBrakeCLI for the current instance.
/// </summary>
- /// <param name="before">List of processes before the new process was started</param>
- /// <returns>Int - Process ID</returns>
- public static int GetCliProcess(Process[] before)
+ /// <returns>A list of processes</returns>
+ public static Process[] GetCliProcess()
{
- // This is a bit of a cludge. Maybe someone has a better idea on how to impliment this.
- // Since we used CMD to start HandBrakeCLI, we don't get the process ID from hbProc.
- // Instead we take the processes before and after, and get the ID of HandBrakeCLI.exe
- // avoiding any previous instances of HandBrakeCLI.exe in before.
- // Kill the current process.
-
- DateTime startTime = DateTime.Now;
- TimeSpan duration;
-
- Process[] hbProcesses = Process.GetProcessesByName("HandBrakeCLI");
- while (hbProcesses.Length == 0)
- {
- hbProcesses = Process.GetProcessesByName("HandBrakeCLI");
- duration = DateTime.Now - startTime;
- if (duration.Seconds > 5 && hbProcesses.Length == 0)
- // Make sure we don't wait forever if the process doesn't start
- return -1;
- }
-
- Process hbProcess = null;
- foreach (Process process in hbProcesses)
- {
- bool found = false;
- // Check if the current CLI instance was running before we started the current one
- foreach (Process bprocess in before)
- {
- if (process.Id == bprocess.Id)
- found = true;
- }
-
- // If it wasn't running before, we found the process we want.
- if (!found)
- {
- hbProcess = process;
- break;
- }
- }
- if (hbProcess != null)
- return hbProcess.Id;
-
- return -1;
+ return Process.GetProcessesByName("HandBrakeCLI");
}
/// <summary>
diff --git a/win/C#/HandBrake.ApplicationServices/Functions/Win7.cs b/win/C#/HandBrake.ApplicationServices/Functions/Win7.cs index 0123139ba..8d694d2f8 100644 --- a/win/C#/HandBrake.ApplicationServices/Functions/Win7.cs +++ b/win/C#/HandBrake.ApplicationServices/Functions/Win7.cs @@ -53,7 +53,7 @@ namespace HandBrake.ApplicationServices.Functions {
return;
}
- windowsTaskbar.SetProgressState(TaskbarProgressBarState.Normal); // todo CHECK THIS
+ windowsTaskbar.SetProgressState(TaskbarProgressBarState.Normal);
windowsTaskbar.SetProgressValue(percentage, 100);
}
|