⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coollistbox.h

📁 在VC中使用coollistview类
💻 H
字号:
#if !defined(AFX_PICKLISTBOX_H__C5446A75_2B7C_11D2_8229_00600815B1D4__INCLUDED_)
#define AFX_PICKLISTBOX_H__C5446A75_2B7C_11D2_8229_00600815B1D4__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// CoolListBox.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CoolListBox window

class CoolListBox : public CListBox
{
// Construction
public:
	CoolListBox();

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CoolListBox)
	public:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	protected:
	virtual void PreSubclassWindow();
	//}}AFX_VIRTUAL

// Implementation
public:
	int AddStringEx(LPCSTR stringText, UINT imgID);
	int InsertStringEx(int index,LPCSTR stringText, UINT imgID);
	int SetItemData( int nIndex, DWORD dwItemData );
	int DeleteString( UINT nIndex );

	DWORD GetItemData( int nIndex ) const;

	virtual ~CoolListBox();
	struct	S_DATA {	UINT	imgIDX;	DWORD	dwData;	};
	// Generated message map functions
protected:
	void Refreshmargins();
	//{{AFX_MSG(CoolListBox)
	afx_msg void OnSelchange();
	afx_msg void OnDestroy();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	
	//}}AFX_MSG
	afx_msg LRESULT	OnEnableDisable(WPARAM wpIndex,LPARAM lpData);

	void CoolListBox::Draw(CDC*	pDC, LPCSTR	string, RECT* prt, S_DATA* pData,
							BOOL bSelected,BOOL bPointed, int& crOldText, int& crOldBack);

	DECLARE_MESSAGE_MAP()
private:
	int			m_nCurSel;
	UINT		m_itemheigth;
	BOOL		m_capture;
	BOOL		m_down;
	BOOL		m_bThisAddData;
	HBRUSH		m_brush;
	CImageList	m_imglist;
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_PICKLISTBOX_H__C5446A75_2B7C_11D2_8229_00600815B1D4__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -