IE9工具栏按钮的自定义图标

时间:2012-04-05 21:41:00

标签: c# internet-explorer bho browser-extension protected-mode

我为IE9添加了一个扩展工具栏按钮。

注册如下:

RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(RegCmd, true);
if (registryKey == null)
   registryKey = Registry.LocalMachine.CreateSubKey(RegCmd);
RegistryKey key = registryKey.OpenSubKey(guid);
if (key == null)
  key = registryKey.CreateSubKey(guid);
key.SetValue("ButtonText", "My Button");
key.SetValue("CLSID", "{1FBA04EE-3024-11d2-8F1F-0000F87ABD16}");
key.SetValue("ClsidExtension", guid);
key.SetValue("Icon", "c:\myicon.ico");
key.SetValue("HotIcon", "c:\myicon.ico");
key.SetValue("Default Visible", "Yes");
key.SetValue("MenuText", "My Button");
key.SetValue("ToolTip", "My Button");
//key.SetValue("KeyPath", "no"); 
registryKey.Close();
key.Close();

问题是 - 图标被引用为文件系统上的文件,而不是URL。 IE Gallery将插件分发为.dll而不是.msi,因此我没有机会将.ico放到本地文件系统上。

如何让按钮使用我的图标?

1 个答案:

答案 0 :(得分:1)

您应该可以将您的图标添加到DLL并使用mydll.dll,0或类似图标的内容。

相关问题