Hi ,

I have did some test program to test BHO. Code as follows. This is working fine. I want to add buttons to IEs any tool bar while remaining these functionality and capture button clicking events.

Code:
using System;
using System.Runtime.InteropServices;
using SHDocVw;
using Microsoft.Win32;
using mshtml;

namespace BHO_Test_1
{
    [ComVisible(true),
    Guid("CBFD6D34-6D83-4c90-845C-1FAFCB5B15C3"),
    ClassInterface(ClassInterfaceType.None)]
    public class DateStamp : IObjectWithSite
    {
        WebBrowser webBrowser;

        public int GetSite(ref Guid guid, out IntPtr ppvSite)
        {
            IntPtr punk = Marshal.GetIUnknownForObject(webBrowser);
            int hr = Marshal.QueryInterface(punk, ref guid, out ppvSite);
            Marshal.Release(punk);
            return hr;
        }

        public int SetSite(object site)
        {
            if (site != null)
            {
                webBrowser = (WebBrowser)site;
                webBrowser.DocumentComplete += new
                DWebBrowserEvents2_DocumentCompleteEventHandler(this.OnDocumentComplete);
            }
            else
            {
                webBrowser.DocumentComplete -= new
                DWebBrowserEvents2_DocumentCompleteEventHandler(this.OnDocumentComplete);
                webBrowser = null;
            }
            return 0;
        }

        private void OnDocumentComplete(object frame, ref object urlObj)
        {
            if (webBrowser != frame) return;
            IHTMLDocument2 document = (IHTMLDocument2)webBrowser.Document; document.body.innerHTML = document.body.innerHTML +
            DateTime.Now.ToShortDateString();
            return;
        }

        public static string BHOKEYNAME = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Browser Helper Objects";
        [ComRegisterFunction] 
        public static void RegisterBHO(Type t)
        {
            RegistryKey key = Registry.LocalMachine.OpenSubKey(BHOKEYNAME, true);
            if (key == null) key = Registry.LocalMachine.CreateSubKey(BHOKEYNAME);
            string guidString = t.GUID.ToString("B");
            RegistryKey bhoKey = key.OpenSubKey(guidString);
            if (bhoKey == null) bhoKey = key.CreateSubKey(guidString);
            key.Close();
            bhoKey.Close();
        }

        [ComUnregisterFunction]
        public static void UnregisterBHO(Type t)
        {
            RegistryKey key = Registry.LocalMachine.OpenSubKey(BHOKEYNAME, true);
            string guidString = t.GUID.ToString("B");
            if (key != null) key.DeleteSubKey(guidString, false);
        }

    }
}

Thanks,

Dinesh