Merge pull request #1373 from jdpurcell/patch7

TaskBarList fixes
This commit is contained in:
Nikolaj Olsson 2015-10-17 10:11:19 +02:00
commit 929076eb6f
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Core
/// </summary>
public static class TaskbarList
{
private static readonly Lazy<bool> SupportedLazy = new Lazy<bool>(() => Environment.OSVersion.Version >= new Version(6, 1));
private static readonly Lazy<bool> SupportedLazy = new Lazy<bool>(() => Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version >= new Version(6, 1));
private static readonly Lazy<ITaskbarList3> TaskbarListLazy = new Lazy<ITaskbarList3>(() => (ITaskbarList3)new CLSID_TaskbarList());
public static bool Supported { get { return SupportedLazy.Value; } }

View File

@ -319,7 +319,7 @@ namespace Nikse.SubtitleEdit.Forms
labelProgress.Text = string.Empty;
labelInfo.Text = string.Empty;
progressBar1.Visible = false;
TaskbarList.SetProgressState(Handle, TaskbarButtonProgressFlags.NoProgress);
TaskbarList.SetProgressState(Owner.Handle, TaskbarButtonProgressFlags.NoProgress);
buttonRipWave.Enabled = true;
buttonInputBrowse.Enabled = true;
buttonSearchFolder.Enabled = true;
@ -342,7 +342,7 @@ namespace Nikse.SubtitleEdit.Forms
{
if (progressBar1.Value < progressBar1.Maximum)
progressBar1.Value++;
TaskbarList.SetProgressValue(Handle, progressBar1.Value, progressBar1.Maximum);
TaskbarList.SetProgressValue(Owner.Handle, progressBar1.Value, progressBar1.Maximum);
labelProgress.Text = progressBar1.Value + " / " + progressBar1.Maximum;
}