主题:[讨论]视频会议源码源代码使用真彩工具条类
视频会议源码源代码使用真彩工具条类
视频会议客户端+服务端全套绝对完整源代码。视频监控远程教学视频会议源码源代码出售,极具参考价值。免费代码 多年开发完成的高性能的软件视频会议系统,支持多路视频,支持混音,可以多人同时说话。视频清晰,语音清楚,可以提供测试版本。可以提供网络视频会议定制 源代码出售 可以录制视频会议,提供4路混音、16路视频,并提供电子白板、共享文档、协同浏览、文字交谈、文字私聊、文件传送等数据协作功能。现出售全部源代码,可先免费试用产品,有开发文档 代码文档以及视频音频编码以及接口 都有说明文档 可做远程视频教学以及远程视频培训 在低带宽网络情况下可支持大规模用户并发访问,无延迟。视频会议源代码下载 视频会议源码,远程视频教育,远程视频培训,免费视频会议,视频会议破解,视频会议免费测试试用,出售视频会议源码,价廉物美,可以用来修改成视频会议,收费性质的聊天室等。如有需要视频会议源代码源码,请与qq:877720619,flyinvedio@sina.com
经过修改的完整工具条类,真彩色按钮,带工具条背景(修改增加的功能),使用方法参考vckbase上对CTrueColorToolBar有说明。
/////////////////////////////////////////////////////////////////////////////
// CTrueColorToolBar
CTrueColorToolBar::CTrueColorToolBar()
{
HBITMAP hBmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(),
WBToolBar_Bkgnd, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
ASSERT(hBmp != NULL);
if( hBmp ){
m_bruBkgnd.CreatePatternBrush(CBitmap::FromHandle(hBmp));
::DeleteObject(hBmp);
}else{
m_bruBkgnd.CreateSolidBrush( GetSysColor(COLOR_3DFACE));
}
}
CTrueColorToolBar::~CTrueColorToolBar()
{
}
BEGIN_MESSAGE_MAP(CTrueColorToolBar, CToolBar)
//{{AFX_MSG_MAP(CTrueColorToolBar)
ON_WM_NCPAINT()
ON_WM_ERASEBKGND()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_IDLEUPDATECMDUI, OnIdleUpdateCmdUI)
ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnDrawTBItem)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTrueColorToolBar message handlers
BOOL CTrueColorToolBar::LoadTrueColorToolBar(int nBtnWidth,
UINT uToolBar,
UINT uToolBarHot,
UINT uToolBarDisabled)
{
if (!SetTrueColorToolBar(TB_SETIMAGELIST, uToolBar, nBtnWidth))
return FALSE;
if (!SetTrueColorToolBar(TB_SETHOTIMAGELIST, uToolBarHot, nBtnWidth))
return FALSE;
if (uToolBarDisabled) {
if (!SetTrueColorToolBar(TB_SETDISABLEDIMAGELIST, uToolBarDisabled, nBtnWidth))
return FALSE;
}
return TRUE;
}
BOOL CTrueColorToolBar::SetTrueColorToolBar(UINT uToolBarType,
UINT uToolBar,
int nBtnWidth)
{
CImageList cImageList;
CBitmap cBitmap;
BITMAP bmBitmap;
CSize cSize;
int nNbBtn;
if (!cBitmap.Attach(LoadImage(AfxGetInstanceHandle(),
MAKEINTRESOURCE(uToolBar),
IMAGE_BITMAP, 0, 0,
LR_DEFAULTSIZE|LR_CREATEDIBSECTION)) ||
!cBitmap.GetBitmap(&bmBitmap))
return FALSE;
cSize = CSize(bmBitmap.bmWidth, bmBitmap.bmHeight);
nNbBtn = cSize.cx/nBtnWidth;
RGBTRIPLE* rgb = (RGBTRIPLE*)(bmBitmap.bmBits);
COLORREF rgbMask = RGB(rgb[0].rgbtRed,
rgb[0].rgbtGreen,
rgb[0].rgbtBlue);
if (!cImageList.Create(nBtnWidth, cSize.cy,
ILC_COLOR24|ILC_MASK,
nNbBtn, 0))
return FALSE;
if (cImageList.Add(&cBitmap, rgbMask) == -1)
return FALSE;
/*
if (uToolBarType == TB_SETIMAGELIST)
GetToolBarCtrl().SetImageList(&cImageList);
else if (uToolBarType == TB_SETHOTIMAGELIST)
GetToolBarCtrl().SetHotImageList(&cImageList);
else if (uToolBarType == TB_SETDISABLEDIMAGELIST)
GetToolBarCtrl().SetDisabledImageList(&cImageList);
else
return FALSE;
*/
SendMessage(uToolBarType, 0, (LPARAM)cImageList.m_hImageList);
cImageList.Detach();
cBitmap.Detach();
return TRUE;
}
void CTrueColorToolBar::OnDrawTBItem(NMHDR * pNotifyStruct, LRESULT *result)
{
/* LPNMTBCUSTOMDRAW pNMTBCustomDraw = (LPNMTBCUSTOMDRAW)pNotifyStruct;
CDC *pDC = CDC::FromHandle(pNMTBCustomDraw->nmcd.hdc);
ASSERT(pDC != NULL);
if (pNMTBCustomDraw->nmcd.dwDrawStage == CDDS_PREPAINT)
*result = CDRF_NOTIFYITEMDRAW;
else if (pNMTBCustomDraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT)
{
const int iItem = pNMTBCustomDraw->nmcd.dwItemSpec - 1;
//ASSERT(iItem < GetToolBarCtrl().GetButtonCount()
// && iItem >= 0);
const CRect rcItem = pNMTBCustomDraw->nmcd.rc;
if (pNMTBCustomDraw->nmcd.uItemState == CDIS_HOT)
{
pNMTBCustomDraw->clrBtnFace = RGB(146,174,240);
pDC->FillSolidRect(&rcItem, pNMTBCustomDraw->clrBtnFace);
pDC->Draw3dRect(&rcItem, RGB(59, 109, 173), RGB(59, 109, 173));
}
else if (pNMTBCustomDraw->nmcd.uItemState & CDIS_SELECTED)
{
pNMTBCustomDraw->clrBtnFace = RGB(105, 141, 228);
pDC->FillSolidRect(&rcItem, pNMTBCustomDraw->clrBtnFace);
pDC->Draw3dRect(&rcItem, RGB(59, 109, 173), RGB(59, 109, 173));
}
*result = TBCDRF_NOEDGES;
}
*/
}
BOOL CTrueColorToolBar::OnEraseBkgnd(CDC* pDC)
{
//绘制背景
CRect rcWindow;
GetWindowRect(&rcWindow);
ScreenToClient(&rcWindow);
CRect rcClient;
GetClientRect(&rcClient);
CPoint ptOrg = rcWindow.TopLeft() - rcClient.TopLeft();
CPoint ptOldOrg = pDC->SetBrushOrg(ptOrg);
pDC->FillRect(&rcClient, &m_bruBkgnd);
pDC->SetBrushOrg(ptOldOrg);
return TRUE;
}
void CTrueColorToolBar::OnNcPaint()
{
CWindowDC wdc(this);
CRect rcWindow;
GetWindowRect(&rcWindow);
CRect rcClient;
GetClientRect(&rcClient);
ClientToScreen(&rcClient);
rcClient.OffsetRect(-rcWindow.left, -rcWindow.top);
rcWindow.OffsetRect(-rcWindow.left, -rcWindow.top);
wdc.ExcludeClipRect(rcClient);
wdc.FillRect(rcWindow, &m_bruBkgnd);
}
LRESULT CTrueColorToolBar::OnIdleUpdateCmdUI(WPARAM wParam, LPARAM lParam)
{
// handle delay hide/show
BOOL bVis = GetStyle() & WS_VISIBLE;
UINT swpFlags = 0;
if ((m_nStateFlags & delayHide) && bVis)
swpFlags = SWP_HIDEWINDOW;
else if ((m_nStateFlags & delayShow) && !bVis)
swpFlags = SWP_SHOWWINDOW;
m_nStateFlags &= ~(delayShow|delayHide);
if (swpFlags != 0)
{
SetWindowPos(NULL, 0, 0, 0, 0, swpFlags|
SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
}
// the style must be visible and if it is docked
// the dockbar style must also be visible
if ((GetStyle() & WS_VISIBLE) &&
(m_pDockBar == NULL || (m_pDockBar->GetStyle() & WS_VISIBLE)))
{
//------------------------------------------
//
//CFrameWnd* pTarget = (CFrameWnd*)GetOwner();
//if (pTarget == NULL || !pTarget->IsFrameWnd())
// pTarget = GetParentFrame();
//------------------------------------------
CWnd* pTarget = GetOwner();
if (pTarget == NULL)
pTarget = GetParentFrame();
if (pTarget != NULL)
OnUpdateCmdUI((CFrameWnd*)pTarget, (BOOL)wParam);
//警告:上面CToolBar::OnUpdateCmdUI中第一个参数
//的强制转换仅能保证在VC++6.0中是安全的
}
return 0L;
}
视频会议客户端+服务端全套绝对完整源代码。视频监控远程教学视频会议源码源代码出售,极具参考价值。免费代码 多年开发完成的高性能的软件视频会议系统,支持多路视频,支持混音,可以多人同时说话。视频清晰,语音清楚,可以提供测试版本。可以提供网络视频会议定制 源代码出售 可以录制视频会议,提供4路混音、16路视频,并提供电子白板、共享文档、协同浏览、文字交谈、文字私聊、文件传送等数据协作功能。现出售全部源代码,可先免费试用产品,有开发文档 代码文档以及视频音频编码以及接口 都有说明文档 可做远程视频教学以及远程视频培训 在低带宽网络情况下可支持大规模用户并发访问,无延迟。视频会议源代码下载 视频会议源码,远程视频教育,远程视频培训,免费视频会议,视频会议破解,视频会议免费测试试用,出售视频会议源码,价廉物美,可以用来修改成视频会议,收费性质的聊天室等。如有需要视频会议源代码源码,请与qq:877720619,flyinvedio@sina.com
经过修改的完整工具条类,真彩色按钮,带工具条背景(修改增加的功能),使用方法参考vckbase上对CTrueColorToolBar有说明。
/////////////////////////////////////////////////////////////////////////////
// CTrueColorToolBar
CTrueColorToolBar::CTrueColorToolBar()
{
HBITMAP hBmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(),
WBToolBar_Bkgnd, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
ASSERT(hBmp != NULL);
if( hBmp ){
m_bruBkgnd.CreatePatternBrush(CBitmap::FromHandle(hBmp));
::DeleteObject(hBmp);
}else{
m_bruBkgnd.CreateSolidBrush( GetSysColor(COLOR_3DFACE));
}
}
CTrueColorToolBar::~CTrueColorToolBar()
{
}
BEGIN_MESSAGE_MAP(CTrueColorToolBar, CToolBar)
//{{AFX_MSG_MAP(CTrueColorToolBar)
ON_WM_NCPAINT()
ON_WM_ERASEBKGND()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_IDLEUPDATECMDUI, OnIdleUpdateCmdUI)
ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnDrawTBItem)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTrueColorToolBar message handlers
BOOL CTrueColorToolBar::LoadTrueColorToolBar(int nBtnWidth,
UINT uToolBar,
UINT uToolBarHot,
UINT uToolBarDisabled)
{
if (!SetTrueColorToolBar(TB_SETIMAGELIST, uToolBar, nBtnWidth))
return FALSE;
if (!SetTrueColorToolBar(TB_SETHOTIMAGELIST, uToolBarHot, nBtnWidth))
return FALSE;
if (uToolBarDisabled) {
if (!SetTrueColorToolBar(TB_SETDISABLEDIMAGELIST, uToolBarDisabled, nBtnWidth))
return FALSE;
}
return TRUE;
}
BOOL CTrueColorToolBar::SetTrueColorToolBar(UINT uToolBarType,
UINT uToolBar,
int nBtnWidth)
{
CImageList cImageList;
CBitmap cBitmap;
BITMAP bmBitmap;
CSize cSize;
int nNbBtn;
if (!cBitmap.Attach(LoadImage(AfxGetInstanceHandle(),
MAKEINTRESOURCE(uToolBar),
IMAGE_BITMAP, 0, 0,
LR_DEFAULTSIZE|LR_CREATEDIBSECTION)) ||
!cBitmap.GetBitmap(&bmBitmap))
return FALSE;
cSize = CSize(bmBitmap.bmWidth, bmBitmap.bmHeight);
nNbBtn = cSize.cx/nBtnWidth;
RGBTRIPLE* rgb = (RGBTRIPLE*)(bmBitmap.bmBits);
COLORREF rgbMask = RGB(rgb[0].rgbtRed,
rgb[0].rgbtGreen,
rgb[0].rgbtBlue);
if (!cImageList.Create(nBtnWidth, cSize.cy,
ILC_COLOR24|ILC_MASK,
nNbBtn, 0))
return FALSE;
if (cImageList.Add(&cBitmap, rgbMask) == -1)
return FALSE;
/*
if (uToolBarType == TB_SETIMAGELIST)
GetToolBarCtrl().SetImageList(&cImageList);
else if (uToolBarType == TB_SETHOTIMAGELIST)
GetToolBarCtrl().SetHotImageList(&cImageList);
else if (uToolBarType == TB_SETDISABLEDIMAGELIST)
GetToolBarCtrl().SetDisabledImageList(&cImageList);
else
return FALSE;
*/
SendMessage(uToolBarType, 0, (LPARAM)cImageList.m_hImageList);
cImageList.Detach();
cBitmap.Detach();
return TRUE;
}
void CTrueColorToolBar::OnDrawTBItem(NMHDR * pNotifyStruct, LRESULT *result)
{
/* LPNMTBCUSTOMDRAW pNMTBCustomDraw = (LPNMTBCUSTOMDRAW)pNotifyStruct;
CDC *pDC = CDC::FromHandle(pNMTBCustomDraw->nmcd.hdc);
ASSERT(pDC != NULL);
if (pNMTBCustomDraw->nmcd.dwDrawStage == CDDS_PREPAINT)
*result = CDRF_NOTIFYITEMDRAW;
else if (pNMTBCustomDraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT)
{
const int iItem = pNMTBCustomDraw->nmcd.dwItemSpec - 1;
//ASSERT(iItem < GetToolBarCtrl().GetButtonCount()
// && iItem >= 0);
const CRect rcItem = pNMTBCustomDraw->nmcd.rc;
if (pNMTBCustomDraw->nmcd.uItemState == CDIS_HOT)
{
pNMTBCustomDraw->clrBtnFace = RGB(146,174,240);
pDC->FillSolidRect(&rcItem, pNMTBCustomDraw->clrBtnFace);
pDC->Draw3dRect(&rcItem, RGB(59, 109, 173), RGB(59, 109, 173));
}
else if (pNMTBCustomDraw->nmcd.uItemState & CDIS_SELECTED)
{
pNMTBCustomDraw->clrBtnFace = RGB(105, 141, 228);
pDC->FillSolidRect(&rcItem, pNMTBCustomDraw->clrBtnFace);
pDC->Draw3dRect(&rcItem, RGB(59, 109, 173), RGB(59, 109, 173));
}
*result = TBCDRF_NOEDGES;
}
*/
}
BOOL CTrueColorToolBar::OnEraseBkgnd(CDC* pDC)
{
//绘制背景
CRect rcWindow;
GetWindowRect(&rcWindow);
ScreenToClient(&rcWindow);
CRect rcClient;
GetClientRect(&rcClient);
CPoint ptOrg = rcWindow.TopLeft() - rcClient.TopLeft();
CPoint ptOldOrg = pDC->SetBrushOrg(ptOrg);
pDC->FillRect(&rcClient, &m_bruBkgnd);
pDC->SetBrushOrg(ptOldOrg);
return TRUE;
}
void CTrueColorToolBar::OnNcPaint()
{
CWindowDC wdc(this);
CRect rcWindow;
GetWindowRect(&rcWindow);
CRect rcClient;
GetClientRect(&rcClient);
ClientToScreen(&rcClient);
rcClient.OffsetRect(-rcWindow.left, -rcWindow.top);
rcWindow.OffsetRect(-rcWindow.left, -rcWindow.top);
wdc.ExcludeClipRect(rcClient);
wdc.FillRect(rcWindow, &m_bruBkgnd);
}
LRESULT CTrueColorToolBar::OnIdleUpdateCmdUI(WPARAM wParam, LPARAM lParam)
{
// handle delay hide/show
BOOL bVis = GetStyle() & WS_VISIBLE;
UINT swpFlags = 0;
if ((m_nStateFlags & delayHide) && bVis)
swpFlags = SWP_HIDEWINDOW;
else if ((m_nStateFlags & delayShow) && !bVis)
swpFlags = SWP_SHOWWINDOW;
m_nStateFlags &= ~(delayShow|delayHide);
if (swpFlags != 0)
{
SetWindowPos(NULL, 0, 0, 0, 0, swpFlags|
SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
}
// the style must be visible and if it is docked
// the dockbar style must also be visible
if ((GetStyle() & WS_VISIBLE) &&
(m_pDockBar == NULL || (m_pDockBar->GetStyle() & WS_VISIBLE)))
{
//------------------------------------------
//
//CFrameWnd* pTarget = (CFrameWnd*)GetOwner();
//if (pTarget == NULL || !pTarget->IsFrameWnd())
// pTarget = GetParentFrame();
//------------------------------------------
CWnd* pTarget = GetOwner();
if (pTarget == NULL)
pTarget = GetParentFrame();
if (pTarget != NULL)
OnUpdateCmdUI((CFrameWnd*)pTarget, (BOOL)wParam);
//警告:上面CToolBar::OnUpdateCmdUI中第一个参数
//的强制转换仅能保证在VC++6.0中是安全的
}
return 0L;
}