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
|
|