让ListBox控件支持拖动(2)
file://{{AFX_MSG(CMyListBox)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
// NOTE - the ClassWizard will add and remove member functions here.
file://}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
file://{{AFX_INSERT_LOCATION}}
#endif // !defined(AFX_MYLISTBOX_H__CF3EDAA5_BBD7_43CD_80CB_A86B65D9A607__INCLUDED_)
// MyListBox.cpp : implementation file
file://
#include "stdafx.h"
#include "sditest.h"
#include "MyListBox.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// CMyListBox
CMyListBox::CMyListBox()
{
m_LButtonDownFlag = FALSE;
m_MouseMoveFlag = FALSE;
}
CMyListBox::~CMyListBox()
{
}
BEGIN_MESSAGE_MAP(CMyListBox, CListBox)
file://{{AFX_MSG_MAP(CMyListBox)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MOUSEMOVE()
// NOTE - the ClassWizard will add and remove mapping macros here.
file://}}AFX_MSG_MAP
END_MESSAGE_MAP()
- 上一篇:VC中利用ADO共同实现数据库的操作
- 下一篇:VC下实现定时任务的方法讨论