; ========================================================================================
; ========================================================================================
FixIE(Version=0, ExeName="")
{
static Key := "Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION"
static Versions := {7:7000, 8:8888, 9:9999, 10:10001, 11:11001}
if Versions.HasKey(Version)
Version := Versions[Version]
if !ExeName {
if A_IsCompiled
ExeName := A_ScriptName
else
SplitPath, A_AhkPath, ExeName
}
RegRead, PreviousValue, HKCU, %Key%, %ExeName%
MsgBox, 0, FixIE, % "ExeName[" ExeName "]`nPreviousValue[" PreviousValue "]"
if (Version = "")
RegDelete, HKCU, %Key%, %ExeName%
else
RegWrite, REG_DWORD, HKCU, %Key%, %ExeName%, %Version%
return PreviousValue
}