TreeCtrlEx.cpp
资源名称:视频会议系统.rar [点击查看]
上传用户:popouu88
上传日期:2013-02-11
资源大小:2894k
文件大小:2k
源码类别:
IP电话/视频会议
开发平台:
Visual C++
- // TreeCtrlEx.cpp : implementation file
- //
- #include "stdafx.h"
- #include "TreeCtrlEx.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- #pragma comment( lib , "msimg32.lib" )
- /////////////////////////////////////////////////////////////////////////////
- // CTreeCtrlEx
- CTreeCtrlEx::CTreeCtrlEx()
- {
- }
- CTreeCtrlEx::~CTreeCtrlEx()
- {
- }
- BEGIN_MESSAGE_MAP(CTreeCtrlEx, CTreeCtrl)
- //{{AFX_MSG_MAP(CTreeCtrlEx)
- ON_WM_PAINT()
- ON_WM_ERASEBKGND()
- ON_WM_MOUSEMOVE()
- ON_WM_SIZE()
- ON_WM_HSCROLL()
- ON_WM_VSCROLL()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CTreeCtrlEx message handlers
- void CTreeCtrlEx::OnPaint()
- {
- CPaintDC dc( this );
- CDC memDC , dcMask;
- memDC.CreateCompatibleDC( &dc );
- dcMask.CreateCompatibleDC( &dc );
- CBitmap b , b2;
- CRect rc;
- dc.GetClipBox( &rc );
- b.CreateCompatibleBitmap( &dc , rc.Width( ) , rc.Height( ) );
- b2.CreateCompatibleBitmap( &dc , rc.Width( ) , rc.Height( ) );
- memDC.SelectObject( &b );
- dcMask.SelectObject( &b2 );
- CTreeCtrl::DefWindowProc( WM_PAINT ,( WPARAM )memDC.GetSafeHdc( ) , 0 );
- dcMask.FillSolidRect( &rc , RGB( 214 , 239 , 255 ) );
- ::TransparentBlt( dcMask.GetSafeHdc( ) , 0 , 0 , rc.Width( ) , rc.Height( ) , memDC.GetSafeHdc( ) , 0 , 0 , rc.Width( ) , rc.Height( ) , ::GetSysColor( COLOR_WINDOW ) );
- dc.BitBlt( 0 , 0 , rc.Width( ) , rc.Height( ) , &dcMask , 0 , 0 , SRCCOPY );
- }
- BOOL CTreeCtrlEx::OnEraseBkgnd( CDC* pDC )
- {
- return TRUE;
- }
- void CTreeCtrlEx::OnMouseMove(UINT nFlags, CPoint point)
- {
- CTreeCtrl::OnMouseMove(nFlags, point);
- this->Invalidate( );
- }
- void CTreeCtrlEx::OnSize(UINT nType, int cx, int cy)
- {
- CTreeCtrl::OnSize(nType, cx, cy);
- this->Invalidate( );
- }
- void CTreeCtrlEx::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
- {
- CTreeCtrl::OnHScroll(nSBCode, nPos, pScrollBar);
- this->Invalidate( );
- }
- void CTreeCtrlEx::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
- {
- CTreeCtrl::OnVScroll(nSBCode, nPos, pScrollBar);
- this->Invalidate( );
- }