2
Context

When I access ms-settings:easeofaccess-visualeffects (in windows.immersivecontrolpanel_10.0.8.1000), I see the "Animation effects" property:

Screenshot

Switching it disables or [re-]enables animations for at least WinUI ≥ 2 applications.

Request

How can I programmatically switch this?

Rationale
  1. In issues like discuss.kde.org/t/21697/7, being able to provide reproducible reproduction steps would assist the triage assignee.

  2. 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-visualeffects in windows.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
  1. Application
    1. #!/usr/bin/env pwsh
      #Requires -PSEdition Core
      #Requires -version 7.6.0
      

      If ([OperatingSystem]::IsWindows() -Eq $True) { Get-AppxPackage -Name windows.immersivecontrolpanel | Select-Object -Property @( 'Name', 'Version' ) | Format-List }

    2. Name    : windows.immersivecontrolpanel
      Version : 10.0.8.1000
      
  2. OS
    1. #!/usr/bin/env pwsh
      #Requires -PSEdition Core
      #Requires -version 7.6.0
      

      If ([OperatingSystem]::IsWindows() -Eq $True) { Get-ComputerInfo | Select-Object -Property @( 'OsName', 'OsOperatingSystemSKU', 'OsVersion', 'OsBuildNumber' ) | Format-List }

    2. OsName               : Microsoft Windows 11 Pro
      OsOperatingSystemSKU : 48
      OsVersion            : 10.0.26120
      OsBuildNumber        : 26120
      

0 Answers0