📄 clientlistctrl.cpp
字号:
// ClientListCtrl.cpp : implementation file
//
#include "stdafx.h"
#include "Chat Server.h"
#include "ClientListCtrl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CClientListCtrl
CClientListCtrl::CClientListCtrl()
{
}
CClientListCtrl::~CClientListCtrl()
{
}
BEGIN_MESSAGE_MAP(CClientListCtrl, CListCtrl)
//{{AFX_MSG_MAP(CClientListCtrl)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CClientListCtrl message handlers
int CClientListCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CListCtrl::OnCreate(lpCreateStruct) == -1)
return -1;
// DWORD nStyle = GetExtendedStyle()|LVS_EX_FULLROWSELECT;
// SetExtendedStyle(nStyle);
// SetExtendedStyle(LVS_EX_FULLROWSELECT |
// LVS_EX_ONECLICKACTIVATE |
// LVS_EX_UNDERLINEHOT |
// LVS_EX_GRIDLINES);
// TODO: Add your specialized creation code here
InsertColumn(0,"Ip Address");
InsertColumn(1,"Port");
return 0;
}
void CClientListCtrl::PreSubclassWindow()
{
// TODO: Add your specialized code here and/or call the base class
// CHeaderCtrl* pHead = GetHeaderCtrl();
CRect rect;
GetWindowRect(&rect);
int width = rect.Width();
InsertColumn(0,"",LVCFMT_CENTER,20,0);
InsertColumn(1,"OnLine users IP",LVCFMT_CENTER,(width-20)*2/3,1);
InsertColumn(2,"Port",LVCFMT_CENTER,(width-20)*1/3,2);
CListCtrl::PreSubclassWindow();
}
BOOL CClientListCtrl::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Add your specialized code here and/or call the base class
return CListCtrl::PreCreateWindow(cs);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -