Try like this

santhosh kumar replied to nishant sagar at 05-Jul-08 01:54
    Hi,


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

[ComRegisterFunction]
public static void RegisterBHO(Type type)
{
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(BHOKEYNAME, true);

if (registryKey == null)
registryKey = Registry.LocalMachine.CreateSubKey(BHOKEYNAME);

string guid = type.GUID.ToString("B");
RegistryKey ourKey = registryKey.OpenSubKey(guid);

if (ourKey == null)
ourKey = registryKey.CreateSubKey(guid);

ourKey.SetValue("Alright", 1);
registryKey.Close();
ourKey.Close();
}

[ComUnregisterFunction]
public static void UnregisterBHO(Type type)
{
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(BHOKEYNAME, true);
string guid = type.GUID.ToString("B");

if (registryKey != null)
registryKey.DeleteSubKey(guid, false);
}


   Regards,
   Santhosh


Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  How to attach a BHO in currently running IE instance - nishant sagar  05-Jul-08 12:57 12:57:00 AM
      Attach BHO to running instance of IE - Sanjay Verma  05-Jul-08 01:24 1:24:40 AM
      See this for BHO - Sujit Patil  05-Jul-08 01:44 1:44:31 AM
      Try like this - santhosh kumar  05-Jul-08 01:54 1:54:37 AM
          Need to attach BHO to RUNNING IE Instance, not new instances... - nishant sagar  05-Jul-08 05:09 5:09:41 AM
View Posts