|
1
|
1 #pragma once
|
|
|
2
|
|
|
3 class CListViewCtrlEx : public CListViewCtrl {
|
|
|
4 public:
|
|
|
5 CListViewCtrlEx( HWND wnd = NULL ) : CListViewCtrl(wnd) {}
|
|
|
6 CListViewCtrlEx const & operator=( HWND wnd ) { m_hWnd = wnd; return *this; }
|
|
|
7 unsigned InsertColumnEx(unsigned index, const wchar_t * name, unsigned widthDLU);
|
|
|
8 unsigned AddColumnEx( const wchar_t * name, unsigned widthDLU );
|
|
|
9 void FixContextMenuPoint( CPoint & pt );
|
|
|
10 unsigned GetColunnCount();
|
|
|
11
|
|
|
12 unsigned InsertString( unsigned index, const wchar_t * str );
|
|
|
13 unsigned InsertString8( unsigned index, const char * str );
|
|
|
14 unsigned AddString( const wchar_t * str );
|
|
|
15 unsigned AddString8(const char * str);
|
|
|
16 void SetItemText(unsigned item, unsigned subItem, const wchar_t * str );
|
|
|
17 void SetItemText8(unsigned item, unsigned subItem, const char * str );
|
|
|
18
|
|
|
19 void AutoSizeColumn( int iCol ) { SetColumnWidth(iCol, LVSCW_AUTOSIZE) ;}
|
|
|
20 int AddGroup(int iGroupID, const wchar_t * header);
|
|
|
21 };
|
|
|
22
|
|
|
23 // BOOL HandleLVKeyDownMod()
|
|
|
24 #define LVN_KEYDOWN_MOD_HANDLER(id, key, mod, func) \
|
|
|
25 if (uMsg == WM_NOTIFY && LVN_KEYDOWN == ((LPNMHDR)lParam)->code && id == ((LPNMHDR)lParam)->idFrom && ((LPNMLVKEYDOWN)lParam)->wVKey == (key) && GetHotkeyModifierFlags() == (mod)) \
|
|
|
26 { \
|
|
|
27 SetMsgHandled(TRUE); \
|
|
|
28 lResult = func()?1:0; \
|
|
|
29 if(IsMsgHandled()) \
|
|
|
30 return TRUE; \
|
|
|
31 }
|
|
|
32
|
|
|
33 // BOOL HandleLVCopy()
|
|
|
34 #define LVN_COPY_HANDLER(id, func) LVN_KEYDOWN_MOD_HANDLER(id, 'C', MOD_CONTROL, func)
|