public static bool IsMinimizeRestoreAnimationEnabled() { ANIMATIONINFO anim = new ANIMATIONINFO(0); SystemParametersInfo(SPI.SPI_GETANIMATION, anim.cbSize, ref anim, SPIF.None); return(anim.iMinAnimate != 0); }
public static bool GetMinMaxAnimation() { ANIMATIONINFO info = new ANIMATIONINFO(); info.cbSize = (uint)Marshal.SizeOf(typeof(ANIMATIONINFO)); WinUserApi.SystemParametersInfo(SystemParametersInfoParameters.SPI_GETANIMATION, 0, ref info, 0); return(info.iMinAnimate != 0); }
public static void SetMinMaxAnimation(bool enabled) { ANIMATIONINFO info = new ANIMATIONINFO(); info.cbSize = (uint)Marshal.SizeOf(typeof(ANIMATIONINFO)); info.iMinAnimate = enabled ? 1 : 0; WinUserApi.SystemParametersInfo(SystemParametersInfoParameters.SPI_SETANIMATION, 0, ref info, SPIF.SPIF_UPDATEINIFILE); }
public void EnableAnimation() { ANIMATIONINFO ai = new ANIMATIONINFO(); ai.cbSize = (uint)Marshal.SizeOf(ai); ai.iMinAnimate = 1; // turn all animation off SystemParametersInfo(SPI_SETANIMATION, 0, ref ai, SPIF_SENDCHANGE); }
public static void SetMinimizeMaximizeAnimation(bool status) { ANIMATIONINFO animationInfo = new ANIMATIONINFO(status); SystemParametersInfo(0x0048, ANIMATIONINFO.GetSize(), ref animationInfo, SPIF.None); if (animationInfo.IMinAnimate != status) { animationInfo.IMinAnimate = status; SystemParametersInfo(0x0049, ANIMATIONINFO.GetSize(), ref animationInfo, SPIF.SPIF_SENDCHANGE); } }
/// <summary> /// Private helper method that indicates whether the user has Window Animation enabled. /// </summary> /// <returns>true if the user has Window Animation enabled. Otherwise returns false.</returns> private bool UseWindowAnimation() { ANIMATIONINFO animationInfo = new ANIMATIONINFO(); animationInfo.cbSize = Marshal.SizeOf(animationInfo); Win32.SystemParametersInfo(Win32.SPI_GETANIMATION, animationInfo.cbSize, ref animationInfo, 0); bool animateMinimize = (animationInfo.iMinAnimate != 0); return(animateMinimize); }
public static void SetMinimizeMaximizeAnimation(bool status) { ANIMATIONINFO animationInfo = new ANIMATIONINFO(status); SystemParametersInfo(0x0048, ANIMATIONINFO.GetSize(), ref animationInfo, SPIF.None); if (animationInfo.IMinAnimate != status) { animationInfo.IMinAnimate = status; SystemParametersInfo(0x0049, ANIMATIONINFO.GetSize(), ref animationInfo, SPIF.SPIF_SENDCHANGE); } }
private static extern bool SystemParametersInfo(SPI uiAction, uint uiParam, ref ANIMATIONINFO pvParam, SPIF fWinIni);
public static extern bool SystemParametersInfo(SPI uiAction, uint uiParam, ref ANIMATIONINFO pvParam, SPIF fWinIni);
public static void SetMinimizeRestoreAnimation(bool enable) { ANIMATIONINFO anim = new ANIMATIONINFO(enable ? 1 : 0); SystemParametersInfo(SPI.SPI_SETANIMATION, anim.cbSize, ref anim, SPIF.None); }
public static void SetMinimizeRestoreAnimation(bool enable) { ANIMATIONINFO anim = new ANIMATIONINFO(enable ? 1 : 0); SystemParametersInfo(SPI.SPI_SETANIMATION, anim.cbSize, ref anim, SPIF.None); }
public static extern int SystemParametersInfo(int uAction, int uParam, ref ANIMATIONINFO lpvParam, int fuWinIni);
public static extern int SystemParametersInfo(int uAction, int uParam, ref ANIMATIONINFO lpvParam, int fuWinIni);
/// <summary> /// Enable/Disable MinAnimate /// </summary> /// <param name="status"></param> public static void SetMinimizeMaximizeAnimation(bool status) { ANIMATIONINFO animationInfo = new ANIMATIONINFO(status); //System.Threading.Thread.Sleep(500); if (!SystemParametersInfo(SPI.SPI_GETANIMATION, ANIMATIONINFO.GetSize(), ref animationInfo, SPIF.None)) { Win32Exception ex = new Win32Exception(Marshal.GetLastWin32Error()); throw new ApplicationException("SystemParametersInfo get failed: " + ex.Message, ex); } //else // EventLog.WriteEntry("Screen Monitor", "SystemParametersInfo get succeeded ", EventLogEntryType.Information, 1, 1); if (animationInfo.IMinAnimate != status) { animationInfo.IMinAnimate = status; //System.Threading.Thread.Sleep(500); if (!SystemParametersInfo(SPI.SPI_SETANIMATION, ANIMATIONINFO.GetSize(), ref animationInfo, SPIF.SPIF_SENDCHANGE)) { Win32Exception ex = new Win32Exception(Marshal.GetLastWin32Error()); throw new ApplicationException("SystemParametersInfo set failed: " + ex.Message, ex); } //else // EventLog.WriteEntry("Screen Monitor", "SystemParametersInfo set succeeded ", EventLogEntryType.Information, 1, 1); } }
private extern static bool Win32SystemParametersInfo (SPIAction uiAction, uint uiParam, ref ANIMATIONINFO value, uint fWinIni);
private bool SetAnimationControlsAndElements() { bool enabled = false; ANIMATIONINFO animInfo = new ANIMATIONINFO(0); bool bSuccess = true; //Disable options if (!SystemParametersInfo(SPI_SETCLIENTAREAANIMATION, 0, enabled, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)) { bSuccess = false; } if (!SystemParametersInfo(SPI_SETCOMBOBOXANIMATION, 0, enabled, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)) { bSuccess = false; } if (!SystemParametersInfo(SPI_SETLISTBOXSMOOTHSCROLLING, 0, enabled, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)) { bSuccess = false; } if (!SystemParametersInfo(SPI_SETMENUANIMATION, 0, enabled, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)) { bSuccess = false; } if (!SystemParametersInfo(SPI_SETSELECTIONFADE, 0, enabled, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)) { bSuccess = false; } if (!SystemParametersInfo(SPI_SETTOOLTIPANIMATION, 0, enabled, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)) { bSuccess = false; } if (!SystemParametersInfo(SPI_SETTOOLTIPFADE, 0, enabled, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)) { bSuccess = false; } if (!SystemParametersInfo(SPI_SETANIMATION, (System.UInt32)Marshal.SizeOf(typeof(ANIMATIONINFO)), ref animInfo, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)) { bSuccess = false; } //Enable options enabled = true; if (!SystemParametersInfo(SPI_SETCURSORSHADOW, 0, enabled, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)) { bSuccess = false; } if (!SystemParametersInfo(SPI_SETDROPSHADOW, 0, enabled, SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)) { bSuccess = false; } return(bSuccess); }
public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, ref ANIMATIONINFO pvParam, uint fWinIni);
public static bool IsMinimizeRestoreAnimationEnabled() { ANIMATIONINFO anim = new ANIMATIONINFO(0); SystemParametersInfo(SPI.SPI_GETANIMATION, anim.cbSize, ref anim, SPIF.None); return anim.iMinAnimate != 0; }