HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
to the registry HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
key with the name corresponding to the name of the program containing the DWORD value of 8000. I have allocated for this a small class:
using Microsoft.Win32; using System; class BrowserEmulation { private BrowserEmulation() { } /// <summary> /// /// </summary> /// <param name="appName"> </param> public static void Enable(string appName = null) { if (appName == null) appName = AppDomain.CurrentDomain.FriendlyName; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", true); if (regKey != null) { try { regKey.GetValue(appName).ToString(); } catch { regKey.SetValue(appName, 8000, RegistryValueKind.DWord); } } } /// <summary> /// /// </summary> /// <param name="appName"> </param> public static void Disable(string appName = null) { if (appName == null) appName = AppDomain.CurrentDomain.FriendlyName; RegistryKey regKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", true); if (regKey != null) { try { regKey.DeleteValue(appName); } catch { } } } }
using System.Windows.Forms; class Restart { private Restart() { } public static void Go() { Application.Restart(); System.Windows.Application.Current.Shutdown(); } }
Source: https://habr.com/ru/post/166285/