SpicIE上下文菜单 [英] SpicIE Context Menu
问题描述
我有一个SpicIE上下文菜单实现,可以创建一个上下文菜单项。 我想在用户点击上下文菜单项时处理该事件。 SpicIE文档在我看来非常有限。 当用户点击我的上下文菜单项时,有没有人知道如何从IE回到SpicIE代码?
SpicIE示例显示了在单击项目时执行的java脚本。 我是java脚本的新手(并且在其他事情上也可能。) 一个选项可能是在SpicIE生成的DLL中处理的java脚本中引发事件。 我绝对没有理解如何做到这一点。
任何帮助赞赏
I have a SpicIE context menu implementation that creates a context menu item. I want to handle the event when the user clicks on the context menu item. SpicIE documentation seems to me very limited. Does anyone know how I can get from IE back to SpicIE code when user clicks on my context menu item?
The SpicIE sample shows a java script executing when the item is clicked. I am a novice in java script (and prehaps in other things.) One option might be to raise an event in java script that is handled in the SpicIE generated DLL. I have absolutely no ideal how to do this.
Any help appreciated
推荐答案
只需添加方法"CallMymethod"即可。进入您的Host类"继承自SpicIE.Host"
Just add a method "CallMymethod" into your Host class "inherited from SpicIE.Host"
将以下代码保存到test.htm
Save the below code into test.htm
< script type =" text / javascript">
var MyHost = new ActiveXObject(" MyHost.MyHost");
MyHost.CallMymethod(" some Args");
< / script>
<script type="text/javascript">
var MyHost= new ActiveXObject("MyHost.MyHost");
MyHost.CallMymethod("some Args");
</script>
设置菜单命令为
MenuCommand = Path.Combine(Host.GetActivePath()," test.htm");
MenuCommand = Path.Combine(Host.GetActivePath(), "test.htm");
这篇关于SpicIE上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!