본문 바로가기
윈도우프로그래밍

[C#] 윈도우 애니메이션 효과 활성 / 비활성

by 바퀴 굴리는 프로그래머 2018. 3. 17.
반응형

using System.Runtime.InteropServices;

 [StructLayout(LayoutKind.Sequential)]

public struct ANIMATIONINFO

{

    public uint cbSize;

    public int iMinAnimate;

};

 

[DllImport("user32", SetLastError = true)]

[return: MarshalAs(UnmanagedType.Bool)]

public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, ref ANIMATIONINFO pvParam, uint fWinIni);

 

public static uint SPIF_SENDCHANGE = 0x02;

public static uint SPI_SETANIMATION = 0x0049;

 

/// <summary>

/// 윈도우 애니메이션 효과 설정

/// </summary>

/// <param name="animate_enabled">0: Disabled, 1: Enabled</param>

void WindowAnimation_Set(int animate_enabled)

{

    ANIMATIONINFO ai = new ANIMATIONINFO();

    ai.cbSize = Convert.ToUInt32(Marshal.SizeOf(ai));

    ai.iMinAnimate = animate_enabled;   

    SystemParametersInfo(SPI_SETANIMATION, 0, ref ai, SPIF_SENDCHANGE);

}

 

 

https://stackoverflow.com/questions/34995126/disable-windows-effect

 

반응형