"Go" solution Delphi WebBrowser cannot invoke the current browser version

Source: Internet
Author: User

proceduretregedtie.formcreate (Sender:tobject); beginWriteappnametoreg; WebBrowser1.Navigate ('C:\a.html'); End; {--}  {It is important to note that the Getnativesysteminfo function is only started from Windows XP, while the Iswow64process function is from Windows XP with SP2 and Windows Server 2003 with SP1  At first. So it's best to use GetProcAddress when using this function. }  functionTregedtIE.IsWin64:Boolean; varKernel32handle:thandle; Iswow64process:function(Handle:Windows.THandle;varRes:Windows.BOOL): Windows.bool;stdcall; Getnativesysteminfo:procedure(varLpsysteminfo:tsysteminfo);stdcall;    Iswow64:bool;  Systeminfo:tsysteminfo; ConstProcessor_architecture_amd64=9; Processor_architecture_ia64=6; beginKernel32handle:= GetModuleHandle ('KERNEL32. DLL'); ifKernel32handle =0  ThenKernel32handle:= LoadLibrary ('KERNEL32. DLL'); ifKernel32handle <>0 Then    beginiswow64process:= GetProcAddress (Kernel32handle,'iswow64process'); Getnativesysteminfo:= GetProcAddress (Kernel32handle,'Getnativesysteminfo'); ifAssigned (iswow64process) Then      beginiswow64process (GETCURRENTPROCESS,ISWOW64); Result:= isWoW64 andAssigned (Getnativesysteminfo); ifResult Then        beginGetnativesysteminfo (SystemInfo); Result:= (Systeminfo.wprocessorarchitecture = processor_architecture_amd64)or(Systeminfo.wprocessorarchitecture=processor_architecture_ia64); End; End      ElseResult: =False; End    ElseResult: =False; End; {--}  functionTregedtIE.WriteAppNameToReg:Boolean; varReg:tregistry;  spath,sappname:string; beginResult:=True; REG:= Tregistry.Create; TryReg. Rootkey:=HKEY_LOCAL_MACHINE; Spath:='software\microsoft\internet Explorer\main\featurecontrol\feature_browser_emulation'; ifIsWin64 Thenspath:='software\wow6432node\microsoft\internet explorer\main\featurecontrol\feature_browser_emulation'; ifReg. Openkey (Spath,true) Then      beginSappname:=Extractfilename (application.exename); if notReg. Valueexists (Sappname) ThenReg. Writeinteger (Sappname,0); End; Reg.    Closekey; finally      Freeandnil(REG); End; End; {--}  procedureTregedtie.webbrowser1documentcomplete (asender:tobject; ConstPdisp:idispatch;varurl:olevariant); beginWebBrowser1.OleObject.Document.Body.Scroll:='No'; WebBrowser1.OleObject.Document.Body.style.border:='None'; WebBrowser1. OleObject.Document.Body.Style.margin:='0px'; End;

http://blog.csdn.net/wensibo/article/details/25971863

"Go" solution Delphi WebBrowser cannot invoke the current browser version

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.