delphi – TWebBrowser(TEmbeddedWB)控件中的拼写检查程序

Internet Explorer 10内置了拼写检查功能,工作正常.我尝试创建一个小的 HTML页面,用以下内容对其进行测试:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META name=GENERATOR content="MSHTML 10.00.9200.16721"></HEAD>
<BODY spellcheck=true contentEditable=true style="MARGIN: 0.5em">
<P>Theze ara mispeled wordz</P>
</BODY></HTML>

所需要的只是将属性spellcheck = true和contentEditable = true.

我还尝试添加< meta http-equiv =“X-UA-Compatible”content =“IE = 10”/>例如

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<meta http-equiv="X-UA-Compatible" content="IE=10" />
<META name=GENERATOR content="MSHTML 10.00.9200.16721"></HEAD>
<BODY spellcheck=true contentEditable=true style="MARGIN: 0.5em">
<P>Theze ara mispeled wordz</P>
</BODY></HTML>

就此而言,使用IE = edge而不是IE = 10没有任何区别:
What does <meta http-equiv=”X-UA-Compatible” content=”IE=edge”> do?

然后我尝试将设置FEATURE_BROWSER_EMULATION添加到注册表:
http://www.west-wind.com/weblog/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version

这改进了某些元素的渲染,这些元素具有像border-radius这样的CSS样式,所以至少我可以看到它处于IE10模式,但仍然没有拼写检查.

上面的页面在Internet Explorer浏览器中工作,拼写检查正常.

但是,当相同的内容加载到TWebBrowser(我使用TEmbeddedWB,但它只是相同的包装)时它不起作用.

谷歌搜索和谷歌搜索解决方案后,仍然没有找到一个.你知道这在WebBrowser控件中是否可行?我需要的解决方案可以在Windows 7上运行,而不仅仅是Windows 8.我已经看到了注册表项FEATURE_SPELLCHECKING,但它仅适用于Windows 8.

是否有任何替代解决方案可以在TWebBrowser控件的DesignMode中工作?我正在寻找弯曲的红色下划线,如Word或其他程序和可能的GUI窗口,以提供替代单词.

解决方法

我觉得你这里运气不好.
Microsoft Connect有一个关于FEATURE_SPELLCHECKING和Windows 7的错误报告.不幸的是它已经“关闭”了.

这是微软的官方回答:

Thank you for your feedback.

After additional review,the spelling feature is only supported on
Windows 8 and higher and is not supported on Windows 7. This is
because the spelling feature was built into the Windows 8 platform.

Best regards,

The Internet Explorer Team

相关文章

 从网上看到《Delphi API HOOK完全说明》这篇文章,基本上都...
  从网上看到《Delphi API HOOK完全说明》这篇文章,基本上...
ffmpeg 是一套强大的开源的多媒体库 一般都是用 c/c+&#x...
32位CPU所含有的寄存器有:4个数据寄存器(EAX、EBX、ECX和ED...
1 mov dst, src dst是目的操作数,src是源操作数,指令实现的...