CMyListCtrl
1. MyListCtrl.h #pragma once #include <vector> #include "resource.h" // CMyListCtrl #ifdef DLL_IMPLEMENT #define DLL_API __declspec(dllexport) #else #define DLL_API __declspec(dllimport) #endif typedef unsigned int UINT; #define ID_LIST_SET_FONT 1001 #define ID_LIST_SAVE_ALL 1002 class DLL_API CMyListCtrl : public CListCtrl { struct SColumn { UINT index, order, width; TCHAR name[128]; }; std::vector<SColumn> m_vecColumn; COLORREF m_clrFore, m_clrBack; CFont m_font; CString m_strCfgFileName; int m_nSortCol;//排序列的索引,-1表示无排序列 bool m_bAscent;//true:升序 false:降序 CImageList m_imgList;//列表头的排序图标