// BaseListCtrl.cpp : implementation file
//

#include "stdafx.h"
#include "ascfgbuilder.h"
#include "BaseListCtrl.h"
#include "MemDC.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBaseListCtrl

CBaseListCtrl::CBaseListCtrl()
{
}

CBaseListCtrl::~CBaseListCtrl()
{
}


BEGIN_MESSAGE_MAP(CBaseListCtrl, CListCtrl)
	//{{AFX_MSG_MAP(CBaseListCtrl)
	ON_WM_ERASEBKGND()
	ON_WM_PAINT()
	ON_WM_HSCROLL()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBaseListCtrl message handlers

BOOL CBaseListCtrl::OnEraseBkgnd(CDC* pDC) 
{
	return TRUE;
}

void CBaseListCtrl::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	CMemDC memDC(&dc);
	
	CWnd::DefWindowProc(WM_PAINT, (WPARAM)memDC.m_hDC, 0);
	GetHeaderCtrl()->SendMessage(WM_PAINT, (WPARAM)memDC.m_hDC, 0);
}

void CBaseListCtrl::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
	CPaintDC dc(this); // device context for painting
	CMemDC memDC(&dc);

	GetHeaderCtrl()->SendMessage(WM_PAINT, (WPARAM)memDC.m_hDC, 0);
	CListCtrl::OnHScroll(nSBCode, nPos, pScrollBar);
}
