Context
When I access ms-settings:easeofaccess-visualeffects (in windows.immersivecontrolpanel_10.0.8.1000), I see the "Animation effects" property:
Switching it disables or [re-]enables animations for at least WinUI ≥ 2 applications.
Request
How can I programmatically switch this?
Rationale
In issues like
discuss.kde.org/t/21697/7, being able to provide reproducible reproduction steps would assist the triage assignee.In issues like
github.com/microsoft/winget-cli/issues/3494#issue-1833438918, being able to explain how to defer to the system preference would be useful.
Diagnosis
I have attempted what revisions/1246803/1 provides:
Add-Type -TypeDefinition @" using System; using System.Runtime.InteropServices; [StructLayout(LayoutKind.Sequential)] public struct ANIMATIONINFO { public uint cbSize; public bool iMinAnimate; } public class PInvoke { [DllImport("user32.dll")] public static extern bool SystemParametersInfoW(uint uiAction, uint uiParam, ref ANIMATIONINFO pvParam, uint fWinIni); } "@ $animInfo = New-Object ANIMATIONINFO $animInfo.cbSize = 8 $animInfo.iMinAnimate = $args[0] [PInvoke]::SystemParametersInfoW(0x49, 0, [ref]$animInfo, 3)
...whose $? and output return $True.
However, as #comment2976607_1246803 states:
This doesn't affect "Animation effects" inside
ms-settings:easeofaccess-visualeffectsinwindows.immersivecontrolpanel_10.0.8.1000.
(Lack of) Duplicates
This demonstrates to me that this preference is separate to the one asked about in that answer's related question. Consequently, I have asked this separately.
Environment
Application
-
#!/usr/bin/env pwsh #Requires -PSEdition Core #Requires -version 7.6.0If ([OperatingSystem]::IsWindows() -Eq $True) { Get-AppxPackage -Name windows.immersivecontrolpanel | Select-Object -Property @( 'Name', 'Version' ) | Format-List }
-
Name : windows.immersivecontrolpanel Version : 10.0.8.1000
-
OS
-
#!/usr/bin/env pwsh #Requires -PSEdition Core #Requires -version 7.6.0If ([OperatingSystem]::IsWindows() -Eq $True) { Get-ComputerInfo | Select-Object -Property @( 'OsName', 'OsOperatingSystemSKU', 'OsVersion', 'OsBuildNumber' ) | Format-List }
-
OsName : Microsoft Windows 11 Pro OsOperatingSystemSKU : 48 OsVersion : 10.0.26120 OsBuildNumber : 26120
-
