2012-04-05 36 views
2

我为IE9添加了一个工具栏按钮的扩展。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(); 

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

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

回答

1

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

+0

如何才能“将我的图标添加到我的dll”,以便我可以使用“mydll.dll,0”引用它? – MSC 2017-01-04 20:58:45

+0

@MSC,为此提出问题。 – Joey 2017-01-04 22:57:12

相关问题