现在全是加个toolbar就没了。但我想在上边加界面元素然后响应其事件。。

解决方案 »

  1.   

    哦。没说清楚。写了一个bho...在ie上边添加工具栏。上边要放界面元素
      

  2.   

    Internet Explorer Toolbar Creation
    http://www.codeproject.com/KB/shell/IEToolbar.aspx
      

  3.   

    上面是C#版本的 下面是C++开发的
    2Find Toolbar for IE - Yet Another Sample
    http://www.codeproject.com/KB/shell/2find.aspx
      

  4.   

    这里有一个BHO的TOOLBAR:
    http://www.xuebrothers.net/masterie/cn/superbar.html
      

  5.   

    其实一样的,在你Toolbar创建成功后,你可以在OnCreate里面创建对应的控件ComBox等Create来创建...
      

  6.   


    HBRUSH CDialogCBB::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
    {
    HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); // TODO:  在此更改 DC 的任何属性 // TODO:  如果默认的不是所需画笔,则返回另一个画笔
    if(nCtlColor == CTLCOLOR_LISTBOX)
    {
    int ItemNum = m_Combo.GetCount();
    int iWidth = 0;
    CString strItem;
    CClientDC dc(this);
    int SaveDC = dc.SaveDC();
    dc.SelectObject(GetFont());
    int VSWidth = ::GetSystemMetrics(SM_CXVSCROLL);
    for(int i = 0;i < ItemNum;i++)
    {
    m_Combo.GetLBText(i,strItem);
    int WholeWidth = dc.GetTextExtent(strItem).cx + VSWidth;
    iWidth = max(iWidth,WholeWidth);
    }
    dc.RestoreDC(SaveDC);
    if(iWidth > 0)
    {
    CRect rc;
    pWnd->GetWindowRect(&rc);
    if(rc.Width() != iWidth)
    {
    rc.right = rc.left + iWidth;
    pWnd->MoveWindow(&rc);
    }
    }
    }
    return hbr;
    }