Skip to content

Commit

Permalink
Update setup.ps1
Browse files Browse the repository at this point in the history
Add enable/disable animation effects
  • Loading branch information
starchyunderscore authored Sep 19, 2023
1 parent 4a1d169 commit ff82e96
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions current/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ DO {
Write-Output "4. Change mouse cursor style"
Write-Output "5. Transparency effects"
Write-Output "6. Date and time formats"
Write-Output "7. Animation effects"
# Prompt user for choice
$Themer = Read-Host "`nInput the number of an option from the list above, or leave blank to exit"
switch ($Themer) {
Expand Down Expand Up @@ -530,6 +531,35 @@ public class Wallpaper
}
}
}
7 { # Animation effects
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
$anim = $Host.UI.PromptForChoice("Animation effects?", "", @("&Cancel", "&Enable", "&Disable"), 0)
switch ($anim) {
0 { # Cancel
Write-Output "Canceled"
}
1 { # Enable animation effects
$animInfo.iMinAnimate = $true
[PInvoke]::SystemParametersInfoW(0x49, 0, [ref]$animInfo, 3)
}
2 { # Disable animation effects
$animInfo.iMinAnimate = $false
[PInvoke]::SystemParametersInfoW(0x49, 0, [ref]$animInfo, 3)
}
}
}
}
} until ($Themer -notmatch "\S")
}
Expand Down

0 comments on commit ff82e96

Please sign in to comment.