Remotely/ScreenCast.Win/Capture/WinVisualFx.cs
2019-09-27 23:53:52 -07:00

29 lines
948 B
C#

using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Remotely_ScreenCast.Win.Capture
{
public class WinVisualFx
{
private static object PreviousSetting { get; set; }
public static void RestoreSetting()
{
var vfxKey = Registry.CurrentUser.CreateSubKey(@"Software\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects", true);
vfxKey?.SetValue("VisualFXSetting", PreviousSetting, RegistryValueKind.DWord);
}
public static void SetHighPerformance()
{
var vfxKey = Registry.CurrentUser.CreateSubKey(@"Software\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects", true);
PreviousSetting = vfxKey?.GetValue("VisualFXSetting");
vfxKey?.SetValue("VisualFXSetting", 2, RegistryValueKind.DWord);
}
}
}