BOOL fnBuildLists( CListCtrl& ctrlList )
{
LPTSTR szColumn[] = { _T("time ") , _T("Proto"),
_T("src_addr "),
_T("des_addr "),
_T("size"), _T("data") };
int nMaxCol = sizeof( szColumn )/sizeof( szColumn[0] );
RECT rtList;
ctrlList.GetClientRect( &rtList );
int nWidth = (rtList.right - rtList.left )/nMaxCol;
int nCol;
for( nCol = 0 ; nCol < nMaxCol ; nCol ++)
ctrlList.InsertColumn( nCol, szColumn[nCol], LVCFMT_LEFT, nWidth );
for( nCol = 0 ; nCol < nMaxCol ; nCol ++)
ctrlList.SetColumnWidth( nCol, LVSCW_AUTOSIZE_USEHEADER );
// Enable the full row selection and the drag drop of headers.
DWORD styles = LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_FLATSB;
// Use macro since this is new and not in MFC.
ListView_SetExtendedListViewStyleEx(ctrlList.GetSafeHwnd(), styles, styles );
return TRUE;
}
{
LPTSTR szColumn[] = { _T("time ") , _T("Proto"),
_T("src_addr "),
_T("des_addr "),
_T("size"), _T("data") };
int nMaxCol = sizeof( szColumn )/sizeof( szColumn[0] );
RECT rtList;
ctrlList.GetClientRect( &rtList );
int nWidth = (rtList.right - rtList.left )/nMaxCol;
int nCol;
for( nCol = 0 ; nCol < nMaxCol ; nCol ++)
ctrlList.InsertColumn( nCol, szColumn[nCol], LVCFMT_LEFT, nWidth );
for( nCol = 0 ; nCol < nMaxCol ; nCol ++)
ctrlList.SetColumnWidth( nCol, LVSCW_AUTOSIZE_USEHEADER );
// Enable the full row selection and the drag drop of headers.
DWORD styles = LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_FLATSB;
// Use macro since this is new and not in MFC.
ListView_SetExtendedListViewStyleEx(ctrlList.GetSafeHwnd(), styles, styles );
return TRUE;
}
'KB > MFC/Win32' 카테고리의 다른 글
웹브라우저컨트롤 ShowWindow(SW_HIDE)시 뻑나는 버그 (0) | 2004.03.19 |
---|---|
리소스 영문화 순서 (0) | 2004.03.19 |
[winsock] 블러킹소켓에서 closesocket시 보낼데이타 모두 보내게 기달리기 (0) | 2004.03.19 |
win 2k/xp에서 포커스 받기 커서 배경 바꾸기 (0) | 2004.03.19 |
다른 스레드에서 만든 윈도우의 SetFocus 주기 (2) | 2004.03.19 |