add function to manage taskbar item

changed from manually setting the taskbar overlay, progressvalue and progress state to setting them through a function
This commit is contained in:
MyDrift
2024-07-12 08:00:32 +02:00
parent a86b07a826
commit 73973d7101
12 changed files with 99 additions and 57 deletions

View File

@ -4,7 +4,6 @@ function Invoke-WPFMicrowin {
Invoke MicroWin routines...
#>
$sync["Form"].taskbarItemInfo.ProgressState = "Indeterminate"
if($sync.ProcessRunning) {
$msg = "GetIso process is currently running."
@ -44,6 +43,8 @@ public class PowerManagement {
return
}
Set-WinUtilTaskbaritem -state "Indeterminate"
Write-Host "Target ISO location: $($SaveDialog.FileName)"
$index = $sync.MicrowinWindowsFlavors.SelectedValue.Split(":")[0].Trim()
@ -479,6 +480,6 @@ public class PowerManagement {
# Allow the machine to sleep again (optional)
[PowerManagement]::SetThreadExecutionState(0)
$sync.ProcessRunning = $false
$sync["Form"].taskbarItemInfo.ProgressState = "None"
Set-WinUtilTaskbaritem -state "None"
}
}