Skip to content

Commit 9ab6c77

Browse files
committed
[Enhance] Add support for progress bar on taskbar
1 parent 648c32f commit 9ab6c77

File tree

394 files changed

+1214328
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

394 files changed

+1214328
-3
lines changed

DISMTools.vbproj

+74-3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,24 @@
8383
<Reference Include="Microsoft.Dism, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5bba90053b345501, processorArchitecture=MSIL">
8484
<HintPath>packages\Microsoft.Dism.3.1.0\lib\net40\Microsoft.Dism.dll</HintPath>
8585
</Reference>
86+
<Reference Include="Microsoft.WindowsAPICodePack.Core, Version=8.0.6.0, Culture=neutral, PublicKeyToken=8afb38e9204fc0a9, processorArchitecture=MSIL">
87+
<HintPath>packages\WindowsAPICodePack.8.0.6\lib\net48\Microsoft.WindowsAPICodePack.Core.dll</HintPath>
88+
</Reference>
89+
<Reference Include="Microsoft.WindowsAPICodePack.ExtendedLinguisticServices, Version=8.0.6.0, Culture=neutral, PublicKeyToken=8afb38e9204fc0a9, processorArchitecture=MSIL">
90+
<HintPath>packages\WindowsAPICodePack.8.0.6\lib\net48\Microsoft.WindowsAPICodePack.ExtendedLinguisticServices.dll</HintPath>
91+
</Reference>
92+
<Reference Include="Microsoft.WindowsAPICodePack.Sensors, Version=8.0.6.0, Culture=neutral, PublicKeyToken=8afb38e9204fc0a9, processorArchitecture=MSIL">
93+
<HintPath>packages\WindowsAPICodePack.8.0.6\lib\net48\Microsoft.WindowsAPICodePack.Sensors.dll</HintPath>
94+
</Reference>
95+
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=8.0.6.0, Culture=neutral, PublicKeyToken=8afb38e9204fc0a9, processorArchitecture=MSIL">
96+
<HintPath>packages\WindowsAPICodePack.8.0.6\lib\net48\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
97+
</Reference>
98+
<Reference Include="Microsoft.WindowsAPICodePack.ShellExtensions, Version=8.0.6.0, Culture=neutral, PublicKeyToken=8afb38e9204fc0a9, processorArchitecture=MSIL">
99+
<HintPath>packages\WindowsAPICodePack.8.0.6\lib\net48\Microsoft.WindowsAPICodePack.ShellExtensions.dll</HintPath>
100+
</Reference>
101+
<Reference Include="PresentationFramework">
102+
<Private>True</Private>
103+
</Reference>
86104
<Reference Include="Scintilla.NET, Version=5.6.2.0, Culture=neutral, PublicKeyToken=0221e70ba618311e, processorArchitecture=MSIL">
87105
<HintPath>packages\Scintilla5.NET.5.6.2\lib\net462\Scintilla.NET.dll</HintPath>
88106
</Reference>
@@ -92,31 +110,76 @@
92110
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
93111
<HintPath>packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
94112
</Reference>
95-
<Reference Include="System.Configuration" />
113+
<Reference Include="System.ComponentModel.Composition">
114+
<Private>True</Private>
115+
</Reference>
116+
<Reference Include="System.Configuration">
117+
<Private>True</Private>
118+
</Reference>
96119
<Reference Include="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
97120
<Private>True</Private>
98121
</Reference>
99-
<Reference Include="System.Design" />
122+
<Reference Include="System.Design">
123+
<Private>True</Private>
124+
</Reference>
100125
<Reference Include="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
101126
<Private>True</Private>
102127
</Reference>
128+
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
129+
<HintPath>packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
130+
<Private>True</Private>
131+
<Private>True</Private>
132+
</Reference>
103133
<Reference Include="System.Management">
104134
<Private>True</Private>
105135
</Reference>
106136
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
107137
<HintPath>packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
108138
</Reference>
109-
<Reference Include="System.Numerics" />
139+
<Reference Include="System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
140+
<HintPath>packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll</HintPath>
141+
<Private>True</Private>
142+
<Private>True</Private>
143+
</Reference>
144+
<Reference Include="System.Numerics">
145+
<Private>True</Private>
146+
</Reference>
110147
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
111148
<HintPath>packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
112149
</Reference>
150+
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
151+
<HintPath>packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
152+
<Private>True</Private>
153+
<Private>True</Private>
154+
</Reference>
113155
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
114156
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
115157
</Reference>
158+
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
159+
<HintPath>packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll</HintPath>
160+
<Private>True</Private>
161+
<Private>True</Private>
162+
</Reference>
163+
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
164+
<HintPath>packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
165+
<Private>True</Private>
166+
<Private>True</Private>
167+
</Reference>
168+
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
169+
<HintPath>packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
170+
<Private>True</Private>
171+
<Private>True</Private>
172+
</Reference>
173+
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
174+
<HintPath>packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
175+
<Private>True</Private>
176+
<Private>True</Private>
177+
</Reference>
116178
<Reference Include="System.ServiceModel">
117179
<Private>True</Private>
118180
</Reference>
119181
<Reference Include="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
182+
<HintPath>packages\WindowsAPICodePack.8.0.6\lib\net48\System.Windows.Forms.dll</HintPath>
120183
<Private>True</Private>
121184
</Reference>
122185
<Reference Include="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
@@ -131,6 +194,13 @@
131194
<Reference Include="WeifenLuo.WinFormsUI.Docking.ThemeVS2012, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
132195
<HintPath>packages\DockPanelSuite.ThemeVS2012.3.1.1\lib\net40\WeifenLuo.WinFormsUI.Docking.ThemeVS2012.dll</HintPath>
133196
</Reference>
197+
<Reference Include="WindowsBase">
198+
<Private>True</Private>
199+
</Reference>
200+
<Reference Include="WindowsFormsIntegration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
201+
<HintPath>packages\WindowsAPICodePack.8.0.6\lib\net48\WindowsFormsIntegration.dll</HintPath>
202+
<Private>True</Private>
203+
</Reference>
134204
</ItemGroup>
135205
<ItemGroup>
136206
<Import Include="Microsoft.VisualBasic" />
@@ -784,6 +854,7 @@
784854
<Compile Include="Utilities\DT_Utils.vb" />
785855
<Compile Include="Utilities\ImageWatcher.vb" />
786856
<Compile Include="Utilities\PriReader.vb" />
857+
<Compile Include="Utilities\TaskbarHelper.vb" />
787858
<Compile Include="Videos\Video.vb" />
788859
</ItemGroup>
789860
<ItemGroup>

Installer/dt.iss

+11
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,31 @@ Source: ".\files\DarkUI.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
6767
Source: ".\files\LICENSE"; DestDir: "{#pfDir}"; Flags: ignoreversion
6868
Source: ".\files\Markdig.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
6969
Source: ".\files\Microsoft.Dism.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
70+
Source: ".\files\Microsoft.WindowsAPI*.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
71+
Source: ".\files\PresentationFramework.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
7072
Source: ".\files\Scintilla.NET.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
7173
Source: ".\files\System.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
7274
Source: ".\files\System.Buffers.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
75+
Source: ".\files\System.Co*.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
76+
Source: ".\files\System.Design.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
7377
Source: ".\files\System.Drawing.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
78+
Source: ".\files\System.IO.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
7479
Source: ".\files\System.Management.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
7580
Source: ".\files\System.Memory.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
81+
Source: ".\files\System.Net.Http.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
82+
Source: ".\files\System.Numerics.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
7683
Source: ".\files\System.Numerics.Vectors.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
84+
Source: ".\files\System.Runtime.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
7785
Source: ".\files\System.Runtime.CompilerServices.Unsafe.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
86+
Source: ".\files\System.Security*.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
7887
Source: ".\files\System.ServiceModel.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
7988
Source: ".\files\System.Windows.Forms.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
8089
Source: ".\files\System.Xml.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
8190
Source: ".\files\System.Xml.Linq.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
8291
Source: ".\files\WeifenLuo.WinFormsUI.Docking.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
8392
Source: ".\files\WeifenLuo.WinFormsUI.Docking.ThemeVS2012.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
93+
Source: ".\files\WindowsBase.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
94+
Source: ".\files\WindowsFormsIntegration.dll"; DestDir: "{#pfDir}"; Flags: ignoreversion
8495
Source: ".\files\AutoUnattend\*"; DestDir: "{#pfDir}\AutoUnattend"; Flags: ignoreversion recursesubdirs createallsubdirs
8596
Source: ".\files\bin\*"; DestDir: "{#pfDir}\bin"; Flags: ignoreversion recursesubdirs createallsubdirs
8697
Source: ".\files\docs\*"; DestDir: "{#pfDir}\docs"; Flags: ignoreversion recursesubdirs createallsubdirs

Panels/Get_Ops/InfoSave/ImgInfoSaveDlg.vb

+3
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Public Class ImgInfoSaveDlg
8282
Sub ReportChanges(Message As String, ProgressPercentage As Double)
8383
Label2.Text = Message
8484
ProgressBar1.Value = ProgressPercentage
85+
TaskbarHelper.SetIndicatorState(ProgressPercentage, Windows.Shell.TaskbarItemProgressState.Normal, MainForm.Handle)
8586
Application.DoEvents()
8687
End Sub
8788

@@ -2454,6 +2455,7 @@ Public Class ImgInfoSaveDlg
24542455
Case 5
24552456
Label2.Text = "In attesa che i processi in background finiscano..."
24562457
End Select
2458+
TaskbarHelper.SetIndicatorState(0, Windows.Shell.TaskbarItemProgressState.Indeterminate, MainForm.Handle)
24572459
While MainForm.ImgBW.IsBusy
24582460
Application.DoEvents()
24592461
Thread.Sleep(500)
@@ -2603,6 +2605,7 @@ Public Class ImgInfoSaveDlg
26032605
saveMsg = "Salvataggio dei contenuti..."
26042606
End Select
26052607
ReportChanges(saveMsg, ProgressBar1.Maximum)
2608+
TaskbarHelper.SetIndicatorState(ProgressBar1.Maximum, Windows.Shell.TaskbarItemProgressState.None, MainForm.Handle)
26062609

26072610
' Save the file
26082611
If Contents <> "" And File.Exists(SaveTarget) Then File.WriteAllText(SaveTarget, Contents, UTF8)

Panels/Startup/AutoReload/AutoReloadForm.vb

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Imports Microsoft.Dism
33
Imports System.Threading
44
Imports Microsoft.VisualBasic.ControlChars
55
Imports Microsoft.Win32
6+
Imports DISMTools.Utilities
67

78
Public Class AutoReloadForm
89

@@ -108,10 +109,12 @@ Public Class AutoReloadForm
108109
imgMtPnt.Text = mntMsg
109110
ProgressBar1.Style = ProgressBarStyle.Blocks
110111
ProgressBar1.Value = e.ProgressPercentage
112+
TaskbarHelper.SetIndicatorState(e.ProgressPercentage, Windows.Shell.TaskbarItemProgressState.Normal, Handle)
111113
End Sub
112114

113115
Private Sub BackgroundWorker1_RunWorkerCompleted(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
114116
Refresh()
117+
TaskbarHelper.SetIndicatorState(100, Windows.Shell.TaskbarItemProgressState.None, Handle)
115118
Application.DoEvents()
116119
Thread.Sleep(1000)
117120
Close()
@@ -160,6 +163,7 @@ Public Class AutoReloadForm
160163
Label4.Text = "Punto di montaggio dell'immagine:"
161164
GroupBox1.Text = "Informazioni sull'immagine"
162165
End Select
166+
TaskbarHelper.SetIndicatorState(0, Windows.Shell.TaskbarItemProgressState.Indeterminate, Handle)
163167
Thread.Sleep(2000)
164168
BackgroundWorker1.RunWorkerAsync()
165169
End Sub

Utilities/TaskbarHelper.vb

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Imports System.Windows.Shell
2+
Imports Microsoft.WindowsAPICodePack.Taskbar
3+
4+
Public Class TaskbarHelper
5+
6+
Public Shared Sub SetIndicatorState(value As Integer, state As TaskbarItemProgressState, handle As IntPtr)
7+
Try
8+
TaskbarManager.Instance.SetProgressValue(value, 100, handle)
9+
TaskbarManager.Instance.SetProgressState(state, handle)
10+
Catch ex As Exception
11+
Debug.WriteLine("Could not set TBI. " & ex.Message)
12+
End Try
13+
End Sub
14+
15+
End Class

packages.config

+9
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@
55
<package id="DockPanelSuite.ThemeVS2012" version="3.1.1" targetFramework="net48" />
66
<package id="Markdig" version="0.38.0" targetFramework="net48" />
77
<package id="Microsoft.Dism" version="3.1.0" targetFramework="net48" />
8+
<package id="Microsoft.NETCore.Platforms" version="7.0.0" targetFramework="net48" />
89
<package id="Scintilla5.NET" version="5.6.2" targetFramework="net48" />
910
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
11+
<package id="System.IO" version="4.3.0" targetFramework="net48" />
1012
<package id="System.Memory" version="4.5.5" targetFramework="net48" />
13+
<package id="System.Net.Http" version="4.3.4" targetFramework="net48" />
1114
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
15+
<package id="System.Runtime" version="4.3.0" targetFramework="net48" />
1216
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net48" />
17+
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net48" />
18+
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net48" />
19+
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net48" />
20+
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net48" />
21+
<package id="WindowsAPICodePack" version="8.0.6" targetFramework="net48" />
1322
</packages>
Binary file not shown.
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) .NET Foundation and Contributors
4+
5+
All rights reserved.
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.

0 commit comments

Comments
 (0)