mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-04-03 22:16:30 +00:00
Improve app page with sorting, recommendations and more (#520)
This commit is contained in:
16
Scripts/Threading/DoEvents.ps1
Normal file
16
Scripts/Threading/DoEvents.ps1
Normal file
@@ -0,0 +1,16 @@
|
||||
# Processes all pending WPF window messages (input, render, etc.) to keep the UI responsive
|
||||
# during long-running operations on the UI thread. Equivalent to Application.DoEvents().
|
||||
function DoEvents {
|
||||
if (-not $script:GuiWindow) { return }
|
||||
$frame = [System.Windows.Threading.DispatcherFrame]::new()
|
||||
$null = [System.Windows.Threading.Dispatcher]::CurrentDispatcher.BeginInvoke(
|
||||
[System.Windows.Threading.DispatcherPriority]::Background,
|
||||
[System.Windows.Threading.DispatcherOperationCallback]{
|
||||
param($f)
|
||||
$f.Continue = $false
|
||||
return $null
|
||||
},
|
||||
$frame
|
||||
)
|
||||
$null = [System.Windows.Threading.Dispatcher]::PushFrame($frame)
|
||||
}
|
||||
Reference in New Issue
Block a user