哪位朋友有bho的toolbar上添加按钮或comobox的资料给我点? 现在全是加个toolbar就没了。但我想在上边加界面元素然后响应其事件。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 哦。没说清楚。写了一个bho...在ie上边添加工具栏。上边要放界面元素 Internet Explorer Toolbar Creationhttp://www.codeproject.com/KB/shell/IEToolbar.aspx 上面是C#版本的 下面是C++开发的2Find Toolbar for IE - Yet Another Samplehttp://www.codeproject.com/KB/shell/2find.aspx 这里有一个BHO的TOOLBAR:http://www.xuebrothers.net/masterie/cn/superbar.html 其实一样的,在你Toolbar创建成功后,你可以在OnCreate里面创建对应的控件ComBox等Create来创建... 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;} 把一个char*转化成BSTR的时候,是不是生成了一个_btr_t对象? 需要我手动释放吗? VC6里究竟怎么用iphlpapi.h activex 控件注册时出现 “找不到制定模块” 问一下文件输入输出的问题(菜鸟问,HELP) 超难:如何列举出网络上的所有SQLServer服务器 如何用VC实现,把我采集的到的数据画为一个波形图 救命!!为什么recv只能收到一个字节??? VC中调用Word 如何绑定已连接的SOCK 请问:对usb的通讯应该如何做起 ActiveX控件无法显示发行者 在vc弄语音识别时 加“sphelper.h”和“sapi.h” 出错 该怎么办
http://www.codeproject.com/KB/shell/IEToolbar.aspx
2Find Toolbar for IE - Yet Another Sample
http://www.codeproject.com/KB/shell/2find.aspx
http://www.xuebrothers.net/masterie/cn/superbar.html
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;
}