简体   繁体   中英

Changing the name of Browser Helper Objects

I am registering my BHO this way:

    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();
    }

How can I set name of my BHO which is visible on addons list in IE? At this moment name of extension is taken from namespace of BHO and it looks pretty ugly..

New Answer

You should be able to control the display name using the ProgIdAttribute on your interop class.

Old Answer

It looks like this is possible by setting the (Default) value in your BHO key. Add the following around bhoKey.SetValue("IE Ext", 1); :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM