2011-12-30 48 views
0

我登記我的BHO是這樣的:更改瀏覽器助手的名稱對象

public static string RegistryKeyLocation = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Browser Helper Objects"; 

    [ComRegisterFunction] 
    public static void Register(Type type) 
    { 
     RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(RegistryKeyLocation, Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree); 

     if (registryKey == null) 
     { 
      registryKey = Registry.LocalMachine.CreateSubKey(RegistryKeyLocation); 
     } 

     string guid = type.GUID.ToString("B"); 
     RegistryKey bhoKey = registryKey.OpenSubKey(guid, Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree); 

     if (bhoKey == null) 
     { 
      bhoKey = registryKey.CreateSubKey(guid); 
     }   

     bhoKey.SetValue("IE Ext", 1); 
     registryKey.Close(); 
     bhoKey.Close(); 
    } 

如何設置我的BHO的名稱,即在IE瀏覽器的插件列表中看到?在延長的這一刻名字是從BHO的命名空間採取和它看起來很醜陋..

回答

1

新建答案

你應該能夠在你的互操作類使用ProgIdAttribute控制的顯示名稱。

老回答

它看起來這是在你的BHO鍵設置(默認)值可能。加入以下內容:bhoKey.SetValue("IE Ext", 1);

bhoKey.SetValue(string.Empty, "Some Clean BHO Name"); 
+0

不幸的是,你的提示沒有幫助。 – user1013552 2011-12-30 17:41:09

+0

這應該與本教程中.rgs文件的作用相同:http://msdn.microsoft.com/zh-cn/library/bb250489(v=vs.85).aspx。 – 2011-12-30 17:45:09

+0

我的方法可以做到嗎? – user1013552 2011-12-30 18:21:40