/* Win7.cs $ This file is part of the HandBrake source code. Homepage: . It may be used under the terms of the GNU General Public License. */ namespace HandBrake.ApplicationServices.Functions { using System; using Microsoft.WindowsAPICodePack.Taskbar; /// /// A class implimenting Windows 7 Specific features /// public class Win7 { /// /// The Windows Taskbar /// private TaskbarManager windowsTaskbar; /// /// Initializes a new instance of the class. /// public Win7() { if (IsWindowsSeven) { windowsTaskbar = TaskbarManager.Instance; } } /// /// Gets a value indicating whether this is Windows Seven. /// public bool IsWindowsSeven { get { OperatingSystem os = Environment.OSVersion; return os.Version.Major >= 6 && os.Version.Minor >= 1; } } /// /// Set the Task Bar Percentage. /// /// /// The percentage. /// public void SetTaskBarProgress(int percentage) { if (!IsWindowsSeven) { return; } windowsTaskbar.SetProgressState(TaskbarProgressBarState.Normal); windowsTaskbar.SetProgressValue(percentage, 100); } /// /// Disable Task Bar Progress /// public void SetTaskBarProgressToNoProgress() { if (!IsWindowsSeven) { return; } windowsTaskbar.SetProgressState(TaskbarProgressBarState.NoProgress); } } }