相关疑难解决方法(0)

如何将WebBrowser控件放入IE9标准?

我正在使用自动化(即COM自动化)在Internet Explorer(9)中显示一些HTML:

ie = CoInternetExplorer.Create;
ie.Navigate2("about:blank");
webDocument = ie.Document;
webDocument.Write(szSourceHTML);
webDocument.Close();
ie.Visible = True;
Run Code Online (Sandbox Code Playgroud)

出现Internet Explorer,显示我的html,其开头为:

<!DOCTYPE html>
<HTML>
<HEAD>
   ...
Run Code Online (Sandbox Code Playgroud)

注意: html5标准模式选择加入doctypehtml

除非文件不符合ie9标准模式; 它是在ie8标准模式下: 替代文字


如果我先将html保存到我的电脑:

替代文字

然后查看那个 html文档,将IE放入标准模式:

替代文字

我的问题是如何更新我的SpawnIEWithSource(String html)功能以使浏览器进入标准模式?

void SpawnIEWithSource(String html)
{
   Variant ie = CoInternetExplorer.Create();
   ie.Navigate2("about:blank");
   webDocument = ie.Document;
   webDocument.Write(html);
   webDocument.Close();
   ie.Visible = true;
}
Run Code Online (Sandbox Code Playgroud)

编辑:一个更详细,更不易理解或可读的代码示例,这无助于进一步提出问题可能是:

IWebBrowser2 ie;
CoCreateInstance(CLASS_InternetExplorer, null, CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, IID_WebBrowser2, ie);
ie.AddRef();
ie.Navigate2("about:blank");

IHtmlDocument doc;
dispDoc = ie.Document;
dispDoc.AddRef();
dispDoc.QueryInterface(IHTMLDocument2, doc);
dispDoc.Release()
doc.Write(html); 
doc.Close();
doc.Release();
ie.Visible = true;
ie.Release(); …
Run Code Online (Sandbox Code Playgroud)

com standards html5 automation internet-explorer-9

27
推荐指数
2
解决办法
3万
查看次数

如何在IE9模式下运行Delphi TWebbrowser组件?

由于TWebbrowser在IE7兼容模式下运行,我遇到了TWebbrowser的Javascript错误.

有没有办法防止这种情况,只是让它在IE9模式下运行?

delphi twebbrowser

13
推荐指数
3
解决办法
1万
查看次数

Windows 10中的TWebbrowser:Microsoft Edge(以前称为Spartan)/ Internet Explorer遗留问题

我们知道Internet Explorer将在Windows 10中停止使用,由新的Microsoft Edge(以前代号为"Project Spartan")取代.

有数百万的应用程序使用TWebbrowser,这是一个使用Internet Explorer API的组件.

有没有人知道这些应用程序在未来的Windows版本中如何工作?我们如何准备好让我们的应用程序在未来的Windows版本中运行?

internet-explorer twebbrowser windows-10 microsoft-edge

5
推荐指数
1
解决办法
3858
查看次数

还有其他方法可以在delphi上查看youtube视频吗?

我在http://www.delphiflash.com/demo-youtube-video上看到如何在delphi上加载flash视频,但它不是免费的.还有其他方法吗?

喜欢HTML然后TWebBroeser?

sampleVideo.html //这对TwebBrowser不起作用还有其他方法吗?

<html>
<head>
</style> 
    <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style> 
</head>
<body>
  <object width="640" height="390">
  <param name="movie" value="http://www.youtube.com/v/L7NWdxFAHdY&hl=en_US&feature=player_embedded&version=3">
  </param><param name="allowFullScreen" value="true">
  </param><param name="allowScriptAccess" value="always">
  </param><embed src="http://www.youtube.com/v/L7NWdxFAHdY&hl=en_US&feature=player_embedded&version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390">
  </embed></object>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

youtube delphi flash video activex

2
推荐指数
1
解决办法
6002
查看次数