标签:pen mic int proc ext value open end rto
procedure SetProgramIEVersion(processName: string; ver: Integer); var ARegistry: TRegistry; list: TStringList; verValue: Integer; begin list := TStringList.Create; try list.AddPair(‘11‘, ‘11000‘); list.AddPair(‘10‘, ‘10000‘); list.AddPair(‘9‘, ‘9000‘); list.AddPair(‘8‘, ‘8000‘); list.AddPair(‘7‘, ‘7000‘); if list.IndexOfName(IntToStr(ver)) >= 0 then verValue := StrToInt(list.Values[IntToStr(ver)]) else verValue := 10; if processName = ‘‘ then processName := ExtractFileName(ParamStr(0)); ARegistry := TRegistry.Create; with ARegistry do try RootKey := HKEY_LOCAL_MACHINE; if OpenKey(‘SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION‘, True) then WriteInteger(processName, verValue); CloseKey; finally Free; end; finally list.Free; end; end;
调用方式:
SetProgramIEVersion(‘a.exe‘, 11);
如果是设置自身程序:
SetProgramIEVersion(‘‘, 11);
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION
标签:pen mic int proc ext value open end rto
原文地址:https://www.cnblogs.com/onlyou13/p/11426853.html